Node Version Manager – Simple bash script to manage multiple active node.js versions on the same machine.It is helpful for us to test the application with different versions of node.
Update your system and install prerequisites.
sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install libssl-dev
For a quicker installation, just download and execute the install script provided via cURL or Wget –
Using cURL :
curl https://raw.githubusercontent.com/creationix/nvm/v0.8.0/install.sh | sh
Using Wget :
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.8.0/install.sh | sh
The Script clones the nvm repository to ~/.nvm and adds the source line to your profile (~/.bash_profile if found else ~/.profile).
For manual install create a folder in your filesystem with the nvm.sh file inside it. I am putting
mine in a folder called nvm.
clone the git repository from github into ~/.nvm
git clone https://github.com/creationix/nvm.git ~/.nvm
For activation ,you need to source it from the bash shell using source or . –
It asks the interpreter to interpret the script in the current process. In bash it’s equivalent to:
You need to execute a script in the current process if you want it to change the environment (variables, et al). You can view more details with help . (To clarify . is an alias for source in bash)
This one actually runs the script in a new bash process. It cannot change the environment of the parent, for example it cannot export variables to the parent process.
To download, compile, and install the latest v0.10.x release of node, do this:
nvm install 0.10.29
And then in any new shell just use the installed version:
nvm use 0.10.29
Or you can just run it:
nvm run 0.10.29 –version
If you want to see what versions are installed:
If you want to see what versions are available to install:
More Information on Installation via Node Version Manager : Node Version Manger