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

Const declaration in strict mode #1077

Closed
Starillusion opened this issue Apr 10, 2017 · 5 comments
Closed

Const declaration in strict mode #1077

Starillusion opened this issue Apr 10, 2017 · 5 comments

Comments

@Starillusion
Copy link

Your libraries all seem to to declare 'use strict' then declare variables (directly afterwards!) with 'const'.
This is causing my server application to crash with this error: "SyntaxError: Use of const in strict mode"
There's also a library or two that use the word "class". Node.JS does not like this and throws an error " reserved word". I don't know if other users are having problems with this, but please create a branch with the problems I listed above fixed (replace 'const' declarations with 'var', or figure out how to not have to use strict mode in your libraries.) I hope this fixes other users' problems along with mine....

@lpinca
Copy link
Member

lpinca commented Apr 10, 2017

ws@2 only works in Node.js >= 4.0.0. If you can't update your Node.js version use ws@1.

@lpinca lpinca closed this as completed Apr 10, 2017
@Starillusion
Copy link
Author

Interesting...

@Starillusion
Copy link
Author

But why?

@lpinca
Copy link
Member

lpinca commented Apr 10, 2017

But why?

Node.js 0.10 and 0.12 reached EOL.

Also, where do you get v1?

npm install ws@1

@Starillusion
Copy link
Author

Never knew NPM could install different versions of a module, always thought it installed only the latest version

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

2 participants