当我尝试在aws lambda中执行此操作时,我在以下行出现Error: spawn EACCES
错误。
var zip = childProcess.spawn('zip', [
'-r',
job.destination.name,
'./'
], {
cwd: temporaryDirectoryPath
});
我有一个二进制文件'zip'。
完整错误跟踪:
Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
at createCompressedFile (/var/task/index.js:141:32)
at /var/task/node_modules/async/lib/async.js:718:13
at iterate (/var/task/node_modules/async/lib/async.js:262:13)
at /var/task/node_modules/async/lib/async.js:274:29
at /var/task/node_modules/async/lib/async.js:44:16
at /var/task/node_modules/async/lib/async.js:723:17
at /var/task/node_modules/async/lib/async.js:167:37
答案 0 :(得分:1)
最后,它对我有用。因此所有错误如EACCES,ENOEN ......都已消失。
child_process.spawnSync('mybinary', [], {
shell: true
})