Handling Node version with NVM

When you use the latest version of everything, you may find some outdated plugins or plugins not still stable for the version you are using.

Just now, I’ve tried install grunt-karma and got an error that said grunt-karma requires node 0.8~0.10 and I was using node 0.12.2

Googling for a while I’ve discovered a nice tool to handle different versions of node: NVM

To start using NVM, you can install it running the following command:

curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash


source ~/.profile

Check the version you are using and the available versions to install running:

nvm ls-remote

nvm install <version>, nvm uninstall <version> and nvm use <version> will be your best friends.

Note: If you get -bash: nvm: command not found after run nvm ls-remote, try apt-get install git and try again. Good luck!