Managing multiple versions of Node.js can become a challenge, especially if you’re working on different projects that require specific versions. Luckily, NVM (Node Version Manager) is a tool that simplifies this process, allowing you to install, manage, and switch between various versions of Node.js effortlessly. This guide will show you how to install NVM on Windows, configure it properly, and use it to manage Node.js versions like a pro.
What is NVM and Why Do You Need It?
NVM stands for Node Version Manager, a popular command-line tool that lets you easily install and manage different versions of Node.js on a single machine. This is particularly useful for developers who need to test their code on different Node.js versions or who work on multiple projects requiring different Node.js versions.
Key benefits of using NVM on Windows:
- Install multiple versions of Node.js on your system.
- Switch between Node.js versions with a single command.
- No need for administrative permissions when installing or switching versions of Node.js.
- Easily manage npm versions, as npm is bundled with Node.js.
For any Node.js developer, NVM provides a much more flexible development environment, avoiding conflicts between project dependencies that rely on different Node.js versions.
Prerequisites for Install NVM on Windows
Before installing NVM, make sure you meet the following prerequisites:
- Windows Operating System: This guide is for Windows 10 or 11 users. If you’re using an older version of Windows, it’s recommended to upgrade for better compatibility.
- Command Line Access: You should be familiar with using Command Prompt or PowerShell on Windows. You will use these to install and configure NVM.
- Administrator Privileges: Some installation steps might require administrative permissions to make system changes.
- Node.js: NVM manages Node.js versions, but you do not need to have Node.js installed before using NVM. NVM will handle the installation of Node.js versions itself.

How to Install NVM on Windows?
Unlike Linux and macOS, the installation of NVM on Windows requires a slightly different approach. For Windows, the official NVM project doesn’t provide a native Windows version, but there’s a popular fork called nvm-windows that is designed specifically for Windows users.
Here’s how to install nvm-windows on your system:
Step 1: Download the nvm-windows Installer
- Visit the GitHub page for nvm-windows: https://github.com/coreybutler/nvm-windows.
- On the GitHub page, navigate to the Releases section and download the latest stable version of the nvm-setup.zip file.
- Once the file is downloaded, extract the contents and find the nvm-setup.exe file.
Step 2: Run the Installer
- Double-click on nvm-setup.exe to begin the installation process.
- You’ll be prompted with the Setup Wizard. Click Next to continue.
- Read and accept the License Agreement, then click Next.
- Choose the installation directory where you want NVM to be installed (the default is usually fine). Click Next.
- Choose the directory for storing your Node.js versions. The default is typically C:\Program Files\nodejs or C:\Users\YourUsername\AppData\Roaming\nvm. This folder will store all your Node.js versions.
- Click Install to begin the installation. You might be asked for administrator permission to proceed, so click Yes if prompted.
- Once the installation is complete, click Finish to exit the installer.
Step 3: Verify NVM Installation
To verify that NVM has been installed successfully, open Command Prompt or PowerShell and run the following command:
bashCopy codenvm version
If NVM was installed correctly, you should see the version number of NVM, for example:
Copy code1.1.9
If the command works as expected, NVM is ready for use.
How to Install and Use Node.js with NVM on Windows
Now that NVM is installed, you can use it to install and manage different versions of Node.js. Here’s how to do that:
Step 1: List Available Node.js Versions
To see which versions of Node.js are available for installation, run the following command:
bashCopy codenvm list available
This will display a list of available Node.js versions that you can install on your system.
Step 2: Install a Specific Node.js Version
To install a specific version of Node.js, use the following command:
bashCopy codenvm install <version>
For example, to install Node.js version 14.17.0, run:
bashCopy codenvm install 14.17.0
You can also install the latest stable (LTS) version of Node.js with the following command:
bashCopy codenvm install --lts
Step 3: Use a Specific Node.js Version
After you’ve installed a version of Node.js, you can switch to it by using the nvm use
command. For example, to use version 14.17.0, run:
bashCopy codenvm use 14.17.0
To confirm that the correct version of Node.js is in use, you can run:
bashCopy codenode -v
This will display the active version of Node.js, for example:
Copy codev14.17.0
Step 4: Set a Default Node.js Version
If you want to set a default version of Node.js that will be used whenever you open a new terminal session, use the nvm alias
command. For example, to set version 14.17.0 as the default:
bashCopy codenvm alias default 14.17.0
This ensures that every time you open a terminal, the specified version of Node.js will be used automatically.
How to List and Uninstall Node.js Versions Using NVM
One of the best features of NVM is the ability to manage multiple versions of Node.js easily. Here’s how to list installed versions and uninstall unnecessary ones:
Step 1: List Installed Node.js Versions
To see the versions of Node.js that are currently installed on your system, use the following command:
bashCopy codenvm list
This will display a list of all installed versions along with the current version being used.
Step 2: Uninstall a Node.js Version
To uninstall a version of Node.js, use the following command:
bashCopy codenvm uninstall <version>
For example, to uninstall Node.js version 14.17.0:
bashCopy codenvm uninstall 14.17.0
This will remove the specified version from your system.
Troubleshooting Common NVM Installation Issues on Windows
While installing NVM on Windows is generally straightforward, some users may encounter common issues. Below are some troubleshooting tips:
1. “NVM is not recognized” Error
If you see an error like “nvm is not recognized as an internal or external command”, it usually means that the NVM executable is not properly added to your system’s PATH.
Solution:
- Reopen your Command Prompt or PowerShell session after installation to refresh the PATH environment variable.
- If that doesn’t work, manually add the path to NVM (e.g.,
C:\Program Files\nvm
) to your system’s PATH environment variable.
2. Permission Issues
If you encounter permission issues during installation or when using NVM, try the following:
- Run Command Prompt as Administrator: Right-click on Command Prompt and select Run as administrator to ensure you have the necessary permissions.
- Ensure that your user account has the necessary write permissions to the nvm folder and nodejs folder.
3. NVM Doesn’t Work After Reboot
If NVM isn’t working after a reboot, it could be due to a problem with the configuration files.
Solution:
- Open System Properties > Environment Variables and check if
NVM_HOME
andNVM_SYMLINK
are correctly set. If not, you may need to manually configure them.
4. Unable to Install Node.js Versions
If NVM is unable to download and install Node.js versions, it could be due to network issues or a corrupted cache.
Solution:
- Clear the cache by running:bashCopy code
nvm cache clear
- Try again after clearing the cache.
Conclusion
Install NVM on Windows makes managing multiple versions of Node.js incredibly simple. By following this guide, you now know how to install NVM, install different versions of Node.js, switch between versions, and manage your development environment more efficiently.
Whether you’re a developer working on several Node.js projects or testing code across multiple Node.js versions, NVM ensures a smooth and flexible workflow. Keep your system organized, and avoid version conflicts with ease.
By following these steps and troubleshooting install tips, you should be able to install and use NVM without any issues. Now go ahead and start managing your Node.js versions like a pro!