I already had node 0.10.* and I installed nvm, then through nvm I installed 0.11.13 and 0.10 again.
node --version gives back 0.11.13
I try to use some of the ES6 features I read about and nothing I tried works.
I run my script with node --harmony index.js
...args
says SyntaxError: Unexpected token .
let x = 5;
also gives an error - SyntaxError: Unexpected identifier
Where can I find what's currently supported in 0.11.13?
Try this instead
"use strict"
let x = 5;
console.log(x)
It will work.
run it like following
node --harmony file.js
I had this same issue and found that I was somehow running node 0.12.7 (I know, right?!). Upgrading to the latest (5.6.0) resolved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With