adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

Error when using inside CLI executable

Open mraak opened this issue 8 years ago • 0 comments

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)

mraak avatar Feb 03 '17 12:02 mraak