节点失败的退出代码1

时间:2018-12-05 12:40:51

标签: node.js npm photoshop child-process photoshop-script

我正在尝试使用以下代码通过子进程execsync运行photoshop脚本,但出现错误

try {
    const child_process = require("child_process")
    child_process.execSync('"C:/Program Files/Adobe/Adobe Photoshop CC 2019/Photoshop.exe" Z:/myfile.jsx', (err, stdout, stderr) => {
        if (err) {
            console.log("error here");
        }
    })
        .on('close', function (code, signal) {console.log('go to next step')})
} catch (err) {
    err.stdout;
    err.stderr;
    err.pid;
    err.signal;
    err.status;
}

但是我遇到了错误

{ Error: Command failed: "C:/Program Files/Adobe/Adobe Photoshop CC 2019/Photoshop.exe" Z:/Render2.0/psTextConvertor.jsx
    at checkExecSyncError (child_process.js:611:11)
    at Object.execSync (child_process.js:648:13)
    at startPhotoshop (Z:\Render2.0\tempsqs.js:422:23)
    at mergeFontData (Z:\Render2.0\tempsqs.js:410:9)
    at ChildProcess.<anonymous> (Z:\Render2.0\tempsqs.js:282:21)
    at ChildProcess.emit (events.js:187:15)
    at ChildProcess.EventEmitter.emit (domain.js:442:20)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  status: 1,
  signal: null,
  output: [ null, <Buffer >, <Buffer > ],
  pid: 5492,
  stdout: <Buffer >,
  stderr: <Buffer > }

但是脚本运行完美,但是我没有退出代码,请帮忙

0 个答案:

没有答案
相关问题