How to install multiple version of node.js in Ubuntu using NVM?
Switching Between Versions So if you install the latest Node. js version, and run node -v right after, you'll see the latest version output. To switch through installed versions, nvm provides the nvm use command. This works similarly to the install command.
NVM allows installing multiple node js versions on the same machine and switching between the required node js version.
The best option is node version manager NVM is very simple to install and you can change from one version to another with a simple nvm use command. Show activity on this post. You can use NVM - Node Version Manager, Supports both Windows and Mac. It has all the instructions of how to install and use it.
How to use the terminal. You can for example use gnome-terminal
.
sudo apt-get install build-essential libssl-dev curl git-core
Below we will install NVM.
git clone git://github.com/creationix/nvm.git ~/.nvm
echo "\n. ~/.nvm/nvm.sh" >> .bashrc
In this example I am going to install node v0.4.12. We first need open new bash session. You can also do this by typing bash
again.
$ bash $ nvm install v0.4.12 #This takes a while.
To make the latest v0.4 branch default you do
$ nvm alias default 0.4
When you don't have all dependencies installed you can not compile/install node.js. Then you will need to clean up ~/.nvm
$ rm -rf ~/.nvm/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With