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

SyntaxError: Use of const in strict mode. #1767

Closed
tit opened this issue Feb 23, 2017 · 2 comments
Closed

SyntaxError: Use of const in strict mode. #1767

tit opened this issue Feb 23, 2017 · 2 comments

Comments

@tit
Copy link

tit commented Feb 23, 2017

I have:

  • OSX, Darwin Kernel Version 16.5.0
  • npm, 2.4.1
  • node, v0.10.36
  • lighthouse, 1.5.1

I installed lighthouse # npm install -g lighthouse.
When I call lighthouse in CLI, I have error:

$ lighthouse
/opt/local/lib/node_modules/lighthouse/lighthouse-cli/compiled-check.js:3
const fs = require('fs');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/opt/local/lib/node_modules/lighthouse/lighthouse-cli/index.js:5:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

What did I do wrong?
Sorry for my bad English

@patrickhulce
Copy link
Collaborator

patrickhulce commented Feb 23, 2017

Your version of node is quite old, Lighthouse only officially supports version 6+ (which has support for const/let/a host of other new JS goodies). I suggest grabbing nvm to manage multiple node versions if you still need v0.10 for other packages.

@tit
Copy link
Author

tit commented Feb 23, 2017

@patrickhulce, thanx!
It working for me.
I installed nvm and installed last node version (7.6.0).
After this I correctly run lighthouse.

@tit tit closed this as completed Feb 23, 2017
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