What is NVM (Node Version Manager)?

NVM is a command line tool that allows you to manage different versions of NodeJS. It is known as Node Version Manager and you can easily install this tool on linux or mac or windows machine.

To install NVM on your linux machine you should have curl installed. If you do not know how to install curl try following command:

sudo apt-get install curl

If you are working on different node projects where you have to switch between different node versions nvm will be your best option.

How to install nvm on linux or mac?

To install nvm (node version manager) on your linux try following commands:

# Install nvm using curl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

# or if you do not have curl try
# installing using wget command
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

# check if nvm is installed
nvm -v

# let's install different versions of node
nvm install v8.9.1
nvm install v9.2.0

# check the default 
# version of node
node -v

# switch to another 
# node version
nvm use 9.2.0

# make node version to default
nvm alias default v8.9.1

# to uninstall nvm
nvm uninstall v8.9.0

Above command can be used for any linux based operating system like ubuntu.