Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 6.x throws SyntaxError #193

Closed
btknorr opened this issue Apr 27, 2016 · 10 comments
Closed

Upgrading to 6.x throws SyntaxError #193

btknorr opened this issue Apr 27, 2016 · 10 comments

Comments

@btknorr
Copy link

btknorr commented Apr 27, 2016

const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/brianknorr/Dev/rd-express-server/node_modules/jsonwebtoken/sign.js:1:73)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

We are using node 0.12.9

Thanks,

Brian

@shakty
Copy link

shakty commented Apr 27, 2016

Plus 1. Having the same issue.

@carlnordenfelt
Copy link

Same problem here, we downgraded to 5.7.0.

@amrendraw3
Copy link

This is actually an issue with the package dependencies. I have removed the folder (sudo rm -R jsonwebtoken) from my node_modules and installed the previous stable version of this package - (sudo npm install jsonwebtoken@5.6.0).

This works for me !!

Also change the same version in your package.json file, if you used '*' for jsonwebtoken module.

@carlnordenfelt
Copy link

@amrendraw3 Going back to a previous version is a workaround, not a solution to the issue. You are right in that, for most, the issue is caused by having jsonwebtoken: '*' in package.json (as in our case) but the actual issue lies in version 6.1.0. It might be intentional but in that case the issue has to be resolved as such.

PS. 5.7.0 was the last stable version prior to 6.*

@jfromaniello
Copy link
Member

Thanks for pointing this out, we can try to find out a solution. This is not something in my code but in a dependency that I added: Joi.

However I don't know how long should I keep maintaining modules for node.js versions prior to v4, since v4 is the LTS and current stable version. In this case I don't see any other solution than implementing what I did with Joi in this package.

@carlnordenfelt
Copy link

carlnordenfelt commented Apr 28, 2016

@jfromaniello I think it's fine if version 6.* breaks compatibility with earlier node versions. It's a major update so there is no requirement to be backwards compatible.
It would be good to point this out in the documentation though, and a note about what kind of patches will be done do the 5.7 branch if any (security fixes would be nice, at least for a while).

@btknorr
Copy link
Author

btknorr commented Apr 28, 2016

Ya I agree...just document the compatibility and provide some sort of support for 5.7. Or see if there is an older version of Joi that works with node 0.12.x and above :)

@justinffs
Copy link

@jfromaniello at a minimum you should include the node version dependancy in your package.json like joi does.

"engines": {
    "node": ">=4.0.0"
  },

It would also be nice to have a change log and some sort of warning to users that node < 4 is not supported.

Also 0.12 is considered LTS and will be supported until next year https://github.com/nodejs/LTS

You could use an older version of joi that supports node < 4. For now all of us need to use an old version of this library.

@jfromaniello
Copy link
Member

Fixed in v6.1.2 (I am using an older version of joi now).

@justinffs
Copy link

Awesome thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants