How to Install NVM in Windows

One of my clients recently faced an issue with the SPFx web part. Actually, their web part triggers emails when specific changes are made to the files they uploaded. To fix their problem, I have imported their SPFx solution package into my system to update the code.

After updating the code, I need to build the package for deployment, but we got stuck because Im using the latest SPFx V1.21.11 and my Node version is V22. But the client’s SPFx solution is using the old version 10. To work on the client solution, I had to downgrade my Node version.

But side by side, Im also working for some other clients who are using the latest versions. In this case, I can’t downgrade or upgrade my Node version every time, which isn’t a good option either.

After researching, I found the best solution: NVM [Node Version Manager], which makes switching between node versions easy with simple commands. In this tutorial, I will explain how to use NVM and how to resolve issues that may arise during installation.

What is NVM?

NVM (Node Version Manager) is a tool that helps you use different versions of Node.js on the same computer. If one project needs an older Node version and another project needs a newer one, NVM lets you switch between them easily using simple commands. You don’t need to uninstall or reinstall Node again and again.

There are two types of NVM:

  • nvm-windows = For Windows computers
  • nvm-sh = For macOS, Linux, and WSL.

NVM allows you to easily upgrade to the latest Node.js versions while keeping older versions available for legacy projects.

Download NVM for Windows

When you go to the official NVM download page, you’ll notice that there are many versions of nvm-windows available. Beginners often get confused about which version to download, so I suggest downloading the latest NVM version or an older one based on your project’s needs.

In most cases, the latest version works fine. Download the latest version 1.2.2 from GitHub. In my case, I had a special requirement, so Im downloading the nvm version 1.1.12 from GitHub.

Note: Before installing NVM for Windows, uninstall any existing Node.js versions, as they may conflict with Node.js versions managed by NVM.

  1. Once you click the link above, a zip file named nvm-setup is downloaded to your local system, either to the Downloads folder or to any other folder you choose. Unzip that one, and within that, you will see nvm-setup as below.
nvm for windows
  1. Click nvm-setup; it will open a wizard to allow NVM into your system. Click Yes. Then, the following image will appear. I chose the I accept the agreement option and clicked the Next button.
nvm install windows
  1. Select the installation location by clicking Browse, and then click Next.
nvm for windows download
  1. Select the directory for the installation of Node.js. Then click on Next.
nvm-windows github releases page
  1. This is for email subscription notifications, which can be completely disabled. You can check all options and click Next.
download nvm for windows 11
  1. Provide your email for subscriptions. This is optional; you can leave it blank.
nvm windows github releases
  1. Click Install if you’re ok with the Destination location; if not, go back and change it.
download nvm for windows 11 64 bit
  1. This installs the nvm into your system. Once it is installed, open the command prompt and run the command below to check the nvm version.
nvm --version

If the nvm version number is displayed, the installation was successful.

  1. To see all available Node.js versions that you can install using nvm, run the command below.
nvm list available

In the image below, you can see the list of available Node.js versions that you can download with nvm.

download node js for windows using nvm

Let’s see how to install Node.js using Node Version Manager in the section below.

Commands to Install & Uninstall Node.js

To install a specific version of Node.js using nvm, run the following command.

nvm install <version>

Here, inplace of version, please specify the version number, for example, as below:

nvm install 22.21.1

If you want to install the latest version, then run the command below.

nvm install --lts

To see all the Node.js versions installed in your system, run the command below.

nvm list

To uninstall the Node.js version.

nvm uninstall <version>

Switching Node.js Versions

Run the command below to switch to the specific Node.js version.

nvm use <version>

Specify the version number inplace of <version>, for example:

nvm use 0.10.48

To check the currently active Node.js version, run the command below.

nvm current

Working with NPM

When we switch Node.js versions using Node Version Manager, npm is also switched to the version bundled with that Node.js version. So, to make a package available across all Node.js versions, we need to reinstall it for each version. Here is the command.

npm install -g <package-name>

In the example below, I showed how to reinstall the GulpYeoman, and SharePoint Generator packages after switching Node.js versions. Running this command is mandatory; otherwise, your gulp commands, such as build, serve, package, and yo @microsoft/sharepoint, etc., won’t work.

npm install -g gulp-cli
npm install -g yo
npm install -g @microsoft/generator-sharepoint

Error: Unable to install npm on older Node.js versions 

If you installed the NVM latest version and are trying to install the very old versions of Node.js, you might face the following error.

Unable to install npm on older nodejs versions
error installing 0.10.48: open C:\users\<username>\AppDate\Local\Temp\nvm-npm-978772599\npm-v2.15.1.zip: The system cannot find the file specified.

This basically means NVM was unable to download the old npm file for that Node version. Some of the new NVM releases no longer support installing such very old Node.js versions, so the command fails.

After trying a few options and searching GitHub Issue threads, I found that NVM version 1.1.12 still supports installing older Node.js versions, such as 0.10.x and 4.x, etc. So I downloaded and installed the NVM 1.1.12, and everything worked perfectly.

  • I was able to install Node.js 0.10.48 and later.
  • I was also able to install newer Node.js versions(16,18,20, etc)
  • Switching between them works without any issues.

Even though NVM 1.1.12 is not the latest version, it is more stable for working with very old Node versions.

Conclusion

I hope you found this tutorial helpful! If you’re working with multiple versions of SPFx and Node.js on the same computer, then follow this article and use NVM to switch between the Node.js versions, without uninstalling and reinstalling.

In this tutorial, I explained what NVM is, how to download it, the basic commands for installing and uninstalling Node.js, how to switch between Node.js versions, how to work with npm, and how to resolve errors when installing very old Node.js versions.

Also, look at some SPFx blog posts below:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Live Webinar

Quiz App Using SharePoint Framework (SPFx)

Learn to built a complete Quiz Management solution that enables admins to create and manage quizzes, categories, questions, and settings with an easy automated setup process in SharePoint. It also includes an interactive quiz experience for users and a powerful dashboard to track participation, analyze results, and view detailed performance reports with charts and answer insights.

📅 2nd June 2026 – 10:00 AM EST | 7:30 PM IST

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App