Follow instructions from here: http://www.nearform.com/nodecrunch/nodejs-sudo-free/
You'll need to add the following to your ~/.profile
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
You can nvm use
different versions of node in a shell, but you need to set a current version (nvm alias
) to be automatically available in a new shell:
$ nvm alias default 4.1.1
But you need to start a new shell to see this working.
Remember npm bundles with node, so changing your node version will change your npm version (this will be displayed when you change node versions)
Remember to set nvm use in the shell, and then rebuild node_modules
Just before installing nvm (for iojs and new io/node combined), and nuking my global npm modules, here's what they were for node 0.12.4 projects
/usr/local/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]