nfriedly / node-bestzip

Provides a `bestzip` command that uses the system `zip` if avaliable, and a Node.js implimentation otherwise.
MIT License
80 stars 16 forks source link

Compression failure in 1.1.5 #19

Closed jeswinsimon closed 6 years ago

jeswinsimon commented 6 years ago

Compressing a directory using version 1.1.5 throws the following error:

bestzip hello.zip .\payload\

archive.bulk([ ^

TypeError: archive.bulk is not a function at C:\Users\jeswin.simon\AppData\Roaming\npm\node_modules\bestzip\lib\bestzip.js:70:19 at FSReqWrap.oncomplete (fs.js:123:15)

Environment: OS: Windows 10 Node 6.10.3 npm 3.10.10

jeswinsimon commented 6 years ago

As per the changelog of Archiver, the bulk method was removed in version 2.0.0. bestzip 1.1.5 upgarded to Archiver 2.1.1 whereas the previous version uses Archiver 0.21.0.

aramirez-asuresoftware commented 6 years ago

Observed the same issues as @jeswinsimon - OS independent as expected. Recreated the issue on CentOS.

Lampei commented 6 years ago

Yup, this was why in this issue https://github.com/nfriedly/node-bestzip/issues/10 I had to use a different method. Until the code is updated to use something other than "bulk" we are still reliant on the older archiver.

nfriedly commented 6 years ago

Hey everyone, sorry about this. v1.1.6 should fix it.

There was a PR to update to the latest version of archiver yesterday to resolve a security issue, and the tests passed... But it turned out that we didn't have any tests covering the 'bulk' path. I added a test suite for that, confirmed that it worked with the old archiver@0.21 and failed as expected with the archiver@latest. Then I tested on archiver@1 and it passed there, so that's what I stuck with.

v1.1.6 will be out once CI finishes that should work the same as v1.1.4, except hopefully without the security issue that #18 was trying to resolve.