Node.js is a very popular JavaScript runtime environment used on a lot of web apps. As a developer, you're probably already familiar with the tool, but sometimes, different projects require different versions of Node.js. A project designed with one version of this tool may not work the same on other versions, and thankfully, it's easy to run multiple versions of Node.js on the same PC. How do you manage the different versions? Well, that's what NVM (Node version manager) is for.

Officially, NVM isn't available for Windows 11 (or any Windows version), but there is an unofficial project called NVM for Windows which works just as well. If you're not sure how to use it, we're here to help.

👁 Surface Laptop Studio 2 (12)
How to install Node.js on Windows

If you do any kind of work that involves JavaScript, you might want to use Node.js, and you can install it on Windows with these steps.

How to install NVM for Windows

Installing NVM for Windows is pretty straightforward. All you'll need to do is download and install the program, and then you can use it from within Windows Terminal or PowerShell.

  1. On your PC, head over to the NVM releases page on GitHub.
  2. Choose nvm-setup.exe under Assets.
  3. Once downloaded, launch the setup file.
  4. If prompted by Windows, choose Yes.
  5. Accept the license agreement.
  6. Press Next to confirm the install path.
  7. Press Next again to confirm the directory for the Node.js Symlink.
  8. Press Install and then Finish.

Once the installation is finished, you can confirm nvm is working by opening Command Prompt and entering the command below:

nvm -v

How to install Node versions and switch between them

Once you have NVM, you're ready to use the tool to install and manage different Node.js versions to use your laptop for programming. Here's a quick rundown of how it works:

  1. Open Command Prompt.
  2. To install a new version of Node.js, enter the command below, repalcing [version] with the version you want to install, such as 20.11.0:
    nvm install [version]
  3. To see all installed versions of Node.js, use the following command: nvm list
  4. To switch between installed versions of Node.js, enter the command below, replacing [version] with the version you want to use:
    nvm use [version]
    Of course, you'll need to have that version installed before you can use it.

If you ever stop needing a specific version of Node.js, you can also uninstall it using NVM. Simply enter the command below, followed by the version number you want to remove:

nvm uninstall 

Wrapping up

If you're someone working with Node.js frequently, NVM is an absolutely essential tool to make sure you can switch between different versions easily. We may be missing an official release for Windows, but this unofficial adaptation works flawlessly. The developers are actually working on a successor app called Runtime, but it may be some time before it's finished, so you can stick with NVM for Windows for now.

👁 Java code on a dark computer screen
How to set the Java path in Windows 11

Facing issues coding Java on Windows 11? Set the path first, using these steps