Install n from npm:
$ sudo npm install -g n
Install version 0.12
$ sudo n 0.12.4
Install and switch to version 0.10.
$ sudo n 0.10.35
Now it’s possible to quickly switch between the Node.js version with the command n:
$ n
Check which version you are running:
$ node -v
You might need to update your node modules when switching Node.js version.
$ npm update --save
The –save updates your package.json as well
If update doesn’t work you might need to reinstall all your node modules
$ rm -rf node_modules/
$ npm install