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

Getting an error while running bestzip 1.1.5 (1.1.4 was fine) #20

Closed sparky2708 closed 5 years ago

sparky2708 commented 5 years ago

Hi, I'm getting an error when I upgrade to bestzip 1.1.5. (I don't have this problem under 1.1.4). Any advice on what I am doing wrong?:

bestzip releases/DEV.zip releases/packages/DEV/* && rimraf releases/packages/DEV

E:\svn\trunk\MyProject\node_modules\bestzip\node_modules\yargs\node_modules\find-up\index.js:5
module.exports = (filename, opts = {}) => {
                                 ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at pkgUp (E:\svn\trunk\MyProject\node_modules\bestzip\node_modules\yargs\yargs.js:510:20)
    at guessVersion (E:\svn\trunk\MyProject\node_modules\bestzip\node_modules\yargs\yargs.js:812:17)
    at Object.version (E:\svn\trunk\MyProject\node_modules\bestzip\node_modules\yargs\yargs.js:789:13)
nfriedly commented 5 years ago

I'd say first try updating to v1.1.6; there was a bug in .5.

If that doesn't resolve it, then check what version of node.js are you on? I believe that syntax is valid in node.js v6 and newer, which is the oldest version that is still supported by the node.js foundation.

If all else fails, you can revert to the old version npm install --save-exact bestzip@1.1.4

sparky2708 commented 5 years ago

(1) Looking at https://www.npmjs.com/package/bestzip the latest released version of bestzip appears to be 1.1.5. Where do I get 1.1.6?

(2) You were correct. I was somehow still running Node.js v4 on my machine. Just upgraded to v8 (still referencing bestzip 1.1.5) and now the error has changed to:

bestzip releases/DEV.zip releases/packages/DEV/* && rimraf releases/packages/DEV

Writing releases/packages/DEV/* to releases/DEV.zip...
E:\svn\trunk\MyProject\node_modules\bestzip\lib\bestzip.js:70
          archive.bulk([
                  ^

TypeError: archive.bulk is not a function
    at E:\svn\trunk\MyProject\node_modules\bestzip\lib\bestzip.js:70:19
    at FSReqWrap.oncomplete (fs.js:153:5)
nfriedly commented 5 years ago

Shoot, it failed to publish it https://travis-ci.org/nfriedly/node-bestzip/jobs/419694527#L764

I just did a manual publish of 1.1.6, which should resolve both of those issues.

Next I need to figure out what's wrong with CI...

sparky2708 commented 5 years ago

Thank you very much! Works now using 1.1.6!!!

bestzip releases/DEV.zip releases/packages/DEV/* && rimraf releases/packages/DEV

Writing releases/packages/DEV/* to releases/DEV.zip...
(node:14956) DeprecationWarning: Archiver.bulk() deprecated since 0.21.0
zipped!
nfriedly commented 5 years ago

Awesome!

Sorry about the deprecation warning, that's on the to-do list. But the update was to resolve a security issue, so I think it was worthwhile.