Installing Multiple Versions Of NodeJs Versions On Your Linux System
Today, I'm going to show you how to install and manage multiple versions of NodeJs on your linux system.
We are going to use NVM to install and manage multiple versions of NodeJs on same system. So we need to install NVM first.. To install it just copy paste the below command.
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
The above script will download and install NVM on your Linux box.. Now run the below command to activate it in current terminal session or just close and open your current terminal session.
source ~/.bashrc
Now just check the NVM installation with following command..
nvm --version
It should print version like one shown below..
Installing NodeJs with NVM
Now we are going to see how to install the latest version of Nodejs using NVM..
Just Run the below command to install latest version of nodejs in your system
nvm install node
This will produce output like one shown below.. on successful installation..
You can check the version of node installed with node -v
and npm with npm -v
You can install particular version of NodeJs with npm install version-number
. For example to install NodeJs version 8 you can use nvm install 8
To check the different versions of NodeJs installed in your local system.. run the following command
nvm ls
To switch from one version to other you can use following command.. nvm use version number
. for example to use Node Version 10 you have to run nvm use 10
If you want to set some node version as default version to use ... you can set it with following command.. nvm alias default node-version
.. if you want to set the node version 8 as default one you can set it by running this command nvm alias default 8
Here is the video for above tutorial...
That's it for now.. Thank You.. If you like don't forget to share it guys.. You can follow us on fb.com/opensourceinside and also subscribe our channel on Youtube..