I am trying to update to version 6.2.2 of Node, and tried the instructions in this SO answer, however, I am still getting v.0.12.4 when I type node -v.
Below are the steps I took and the output:
~ sudo npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
~ sudo npm install -g n
/usr/local/opt/nvm/versions/node/v0.12.4/bin/n -> /usr/local/opt/nvm/versions/node/v0.12.4/lib/node_modules/n/bin/n
n@2.1.1 /usr/local/opt/nvm/versions/node/v0.12.4/lib/node_modules/n
~ sudo n stable
~ node -v
v0.12.4
~ sudo n 6.2.2
~ node -v
v0.12.4
When I tried to upgrade node with brew I got the following:
~ brew upgrade node
Error: node 6.2.2 already installed
I'd like to make sure that my app is using version 6.2.2 only (happy to get rid of the older one). When I run npm start on my app, I get an error for using ES6 syntax:
/Users/.../modules/edu.js:28
let x=2;
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
Any help is appreciated!