Nodejs throws an error when trying to run a 7-zip process

Viewed 271

I am trying to use node-7z to unzip files in a NodeJS program.

It threw this error.

Error: spawn 7z ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn 7z',
  path: '7z',
  spawnargs: [
    'x',
    '/var/somefolder/myfolder/uploads/myfile.zip',
    '-pMyPassword',
    '-o/var/somefolder/myfolder',
    '-y',
    '-bb3'
  ]
}
1 Answers

apt install p7zip-full resolved the issue.

Apparently the 7-zip binaries were needed.

Related