NPCRNPCR
NPCRNPCR

Reputation: 355

Aws lambda binary file EACCES error

I got Error: spawn EACCES error at the following line when I tried to execute this in aws lambda.

var zip = childProcess.spawn('zip', [
        '-r',
        job.destination.name,
        './'
    ], {
        cwd: temporaryDirectoryPath
    });

I have a binary file 'zip'.

Full error trace:

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

Upvotes: 1

Views: 1160

Answers (1)

izzaki
izzaki

Reputation: 258

Finally, it worked for me. So all errors like EACCES, ENOEN... has gone.

child_process.spawnSync('mybinary', [], {
  shell: true
})

Upvotes: 1

Related Questions