adm-zip
adm-zip copied to clipboard
Error when using inside CLI executable
This code works when running it purely by node index.js, but fail when publishing to NPM as CLI and running as executable on Windows 7.
var zip = new AdmZip(); zip.addLocalFolder("E:\dev\projects\nodeprojects\testfolder"); zip.writeZip(archiveName);
buffer.js:11 super(arg1, arg2, arg3); ^
RangeError: Invalid typed array length at Buffer.Uint8Array (native) at FastBuffer (buffer.js:11:5) at createUnsafeBuffer (buffer.js:37:10) at allocate (buffer.js:189:12) at Function.Buffer.allocUnsafe (buffer.js:152:10) at tryCreateBuffer (fs.js:445:21) at Object.fs.readFileSync (fs.js:479:14) at C:\Users\baljal\AppData\Roaming\npm\node_modules\watchandzip\node_modules\adm-zip\adm-zip.js:253:6 0 at Array.forEach (native) at Object.addLocalFolder (C:\Users\baljal\AppData\Roaming\npm\node_modules\watchandzip\node_modules\a dm-zip\adm-zip.js:249:27)