Insights

Use NVM to Install Multiple Node Versions on Windows

Learn how to use Node Version Manager (NVM) to install multiple Node versions on Windows.

What is NVM and how is it used?

This blog is intended for developers who are looking to install multiple versions of node on their machine.

If you’re building a web application with any modern framework, chances are you’ll need to install node at some point. Since different projects have different environment setups, you may need to install multiple versions of node on your workstation. As node doesn’t provide any out-of-the-box functionality to have multiple versions of node installed on the same operating system, we'll have to use NVM, which stands for node version manager, to have multiple node versions.

Prerequisites

Before we install multiple node versions via NVM, you will need to uninstall the current node version. 

Get the Current Node Version

Keep note of your current installed version of node before you proceed with the uninstallation, as we will need this later. Open cmd with administrator rights and type the following:

node --version

Install multiple node versions

Uninstall Node

Press Windows Key and search for Add or remove programs.

Install multiple node versions

Search node in the search box and click Uninstall by clicking the three dots.

Install multiple node versions

Install NVM

Download nvm-setup.exe from this link. Double-click it and follow the prompts to install NVM, and don't worry; everything remains default, so there is no need to customize anything.

Verify your installation by typing the following command in cmd.

nvm --version

Install multiple node versions

You'll see a version number in the output if your installation succeeds. Otherwise, you'll see node is not recognized as internal command in the output.

Usage

Remember in the prerequisites that we noted the node version. Well, we will use that now by typing the following command in cmd to install node. For our example, we had 14.17.0, so we'll use that.

nvm install 14.17.0

Install multiple node versions

To use the installed version, we type the following in cmd.

nvm use 14.17.0

Install multiple node versions

One more handy command is nvm list which will display all the installed versions of node on your workstation. It'll also tell you which version is currently being used by displaying '🞷' in front of the version number.

Install multiple node versions

Summary

That's it, folks. Now you can have multiple versions of node installed on your machine. To recap, run:

  • nvm install <version> to install a specified version.
  • nvm use <version> to switch between different versions.
  • nvm list to list all versions installed on your workstation.

Happy decoding!

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting
 

Meet Karan Patel

Sitecore Developer

🚀🎸🎮

Karan is a Sitecore Certified Developer with over 2 years of experience building and implementing Sitecore solutions using ASP .NET MVC, React, Azure and AWS. He's an avid fan of Counter-Strike and can usually be found playing it if he is not developing. In his spare time, he likes to play guitar and cook Indian food.

Connect with Karan