How to run multiple versions of Node.js on a single windows machine
Many of you might be working on different projects at the same time. And different projects may require different node.js versions. It is very tedious and time consuming for developers to uninstall and install different versions of node.js to fit their project requirement all the time.
In this article, we will learn how to install and use multiple versions of node.js on a single machine without the need of creating a new VM (Virtual Machine) for each node.js versions.
With NVM (Node version manager), it is not only possible to install different node.js versions on the same machine but also use them simultaneously in your projects with a single command-line tool. As we go through this article we will learn how simple and easy it is:
Step1: Install NVM for windows:
Pre-requisites for installing NVM (in case you have some version of node.js already installed in your system):
- Uninstall the existing version of the node.js since we won’t be using it anymore
- Delete any existing node.js installation directories. e.g. “C:\Program Files\nodejs”) that might remain. NVM’s generated symlink will not overwrite an existing (even empty) installation directory.
- Delete the npm install directory at C:\Users[Your User]\AppData\Roaming\npm
We are now ready to install nvm.
Go to the nvm-windows Git repository over here.
Click on the ‘nvm-setup.zip’ link from the ‘assets’ table as shown in the image below.

Locate the downloaded setup file, extract it and then double click the nvm-setup.exe to launch the installer. Thus complete the installation of NVM.
Confirm if the NVM installed successfully:
Open the command line terminal and type:

You will see the nvm version installed:

Step2: Install multiple node versions
To install a specific node version:

If you want to install the latest node.js version:

This way you can install multiple node versions using the nvm install command.
Step3: List the available node versions:
To see the installed node versions on your windows machine:

This will output all the available node.js versions on your system like below:

The one marked with a * is the one to which the system path variable is currently pointing to.
Step4: How to use and switch between multiple node versions
To use a specific node version just do nvm use <version> like below:

This will show below output on command line:

So it means your system path variable will be pointing to the specified node version now. Note that you can point to a single node version at a time.
So whenever you are working on a different project which requires a different node.js version, all you need to do is make sure you install the node version as described above in this article and then you do ‘nvm use <nodeversion>’. And you are set to go.
At any point of time, while you install node.js through nvm or switch between different node.js versions through nvm you can always confirm the node.js and npm versions got installed or getting used currently through the commands below.

I hope the above details helped you setup NVM and make use of multiple versions of node.js in your machine.
Below I will share some additional details in case you want to uninstall a node.js version from your machine through NVM. Also if you want to stop using NVM in your machine.
How to uninstall node.js versions
Fortunately, you can remove Node.js versions just as easily as you installed them:

It’s worth noting that you can’t remove a version of Node.js that is currently in use and active.
You may want to stop using nvm. The next section will explain how to do this.
Unloading Node Version Manager
If you would like to completely remove NVM from your machine, you can use the unload command:

Thanks for reading the article !!!
Happy Coding:-)