I'm trying to use node-7z in my Electron app to decrypt password protected zip files, but whenever I pass a password, I get an enoent error. I'm including 7zip-bin and the .7za file is present at the location and when I console.log 7zip-bin.path7za I'm getting a valid exe. If I extract a zip that does not have any password, there is no issues and I have ran npm install in both my project root and the node modules folder, is there anything else I am missing?
Thank you for your help.
const { extractFull } = require('node-7z')
const zipbin = require('7zip-bin')
let testFile = zipLocation + "/zip.zip";
const pathTo7zip = zipbin.path7za;
console.log(pathTo7zip); -->Returns .z7a file path
const myStream = extractFull(testFile, installLocation, { password: 'password' }, {
$bin: pathTo7zip,
$progress: true
})
myStream.on('error', (err) => handleError(err));
}
If I add a password using either p: or password: then I get the below error:
Error: spawn 7z ENOENT
at notFoundError (***app\node_modules\cross-spawn\lib\enoent.js:6)
at verifyENOENT (****app\node_modules\cross-spawn\lib\enoent.js:40)
at ChildProcess.cp.emit (*****app\node_modules\cross-spawn\lib\enoent.js:27)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272)
Without a password, I have no issues, but the whole reason I'm using node-7z is for zip/.7z encryption.