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: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode #6

Open
wiseflat opened this issue Nov 8, 2016 · 0 comments

Comments

@wiseflat
Copy link
Member

wiseflat commented Nov 8, 2016

Hi Olivier,

You updated your main project an I found this mistake :

$ node xpl-sysinfo 
/opt/xpl-sysinfo/node_modules/xpl-api/lib/xpl-api.js:11
class XplAPI extends Events.EventEmitter {
^^^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432: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 Object.<anonymous> (/opt/xpl-sysinfo/lib/xpl-sysinfo.js:1:73)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)

I found on internet this solution :

node --use_strict xpl-sysinfo 

What should I do in my code to solve this issue ?

I can manage to solve this by adding "--user_strict" inside my run level service (systemd, sysvinit or pm2) but it's a bit dirty isn't it ? :-) Should I learn more about es6 ?

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

1 participant