Recently in one of my project, I couldn’t run the
npm install command successfully. After debugging for a while I came to know that I needed previous version of Node.js to install all the dependency successfully.
So I googled and came across the NVM tool which handles such situation. It allow us to install multiple version of the Node.js and maintains them. We can choose whichever version of the Node.js we want and go back to the default once we’re done with it.
To install the latest version of the Node.js:
nvm install node
This will install the latest version of the Node.js.
To install the specific version of the Node.js, for example, if you want to install
0.11.14 version of the Node.js, do this:
nvm install 0.11.14
After installation finished, you need to point NVM to use
0.11.14 version of Node.js like below:
nvm use 0.11.14
To see all the installed version:
This will list all the installed version like below image:
When you’re done with specific version and do not need it any more, you can uninstall it:
nvm uninstall 0.11.14
Hope this helps!
NVM can be life saviour when you work on multiple projects parallel.