Skip to content

This guide and website are in beta! Help us make them awesome with your feedback!

Installing Node.js with Node Version Manager (nvm)

In the world of JavaScript, different projects need different versions of Node.js (and of npm, which comes bundled with it) to run. But switching versions by installing and uninstalling Node.js each time you need something different is not fun.

Enter: Node Version Manager (nvm). nvm lets you keep multiple versions of Node.js installed at the same time, and then swap between them with a single command.

This guide will walk you through installing nvm and one version of Node.js (and npm). After reading this article, you’ll know:

So let’s get started!

Before installing anything, let’s find out what’s already on your computer. Depending on where you’re starting from, your next steps can look a little different.

  1. Open a terminal.

    You can find instructions in How to Choose and Open Your First Terminal if you need them!

  2. Run nvm --version to see if nvm is already installed.

    If nvm is installed, you’ll see its version number:

    Terminal window
    nvm --version
    v2.0.0

    If it isn’t, you’ll get an error:

    Terminal window
    nvm --version
    'nvm' is not recognized as an internal or external command, operable program or batch file.
  3. Run node --version to see if Node.js is already installed.

    If Node.js is installed, you’ll see its version number:

    Terminal window
    node --version
    v24.21.0

    If it isn’t, you’ll get an error, which is good in this case, because it means you’re starting from a clean slate:

    Terminal window
    node --version
    'node' is not recognized as an internal or external command, operable program or batch file.

With the checks done, you know exactly where you’re starting from. Next up: getting nvm on your computer!

Time to install nvm itself! As a reminder, nvm (Node Version Manager) is not Node.js: it’s a manager, a separate tool that installs Node.js versions and switches between them for you.

Knowing which tool you’re dealing with is especially important when you’re troubleshooting. There are many ways to manage Node.js versions, and more than one program called “Node Version Manager.” In this guide, you’ll use one of these two:

Coding in WSL on Windows? You’ll need nvm-sh, as explained earlier.

They’re both called nvm, but they’re two distinct tools by different developers. Many of their commands are the same, but the differences can bite you when you least expect it! If you run into trouble, make sure you’re reading the documentation for the right one.

Keep in mind, installing nvm does not install a particular Node.js version for you. nvm is the tool that installs Node.js, not Node.js itself. You will choose and install your first Node.js version (and thus, npm version) in the next section.

NVM for Windows uses a standalone installer.

  1. Confirm Node.js is not already installed.

    A preexisting Node.js installation can mess with NVM for Windows, so make sure you checked for Node.js and uninstalled it, if necessary.

  2. Find the latest release on the NVM for Windows “Releases” page.

    The latest version appears towards the top. Make sure to pick a release with a “Latest” label, and not a “Pre-release” one.

  3. Download the installer.

    Under Assets, choose the installer for your computer:

    • Most Intel or AMD computers: nvm-2.x.x-x64-setup.exe
    • ARM computers: nvm-2.x.x-arm64-setup.exe

    The similarly named sync.exe files are not installers.

  4. Run the .exe file normally.

    With version 2 and above you don’t need to run the installer as Administrator. In fact, if you run it as Administrator, you might run into issues!

    You might still see a Windows permission prompt during the installation. That’s expected, so go ahead and select Yes.

  5. Accept the defaults and complete the installation.

Now that you’re done with the installation, confirm nvm has been installed correctly:

  1. Open a new terminal window.

    If you already had a terminal open while installing nvm, it might not automatically register the new installation. Close it, then open a new one.

  2. Run nvm --version to see if nvm has been installed.

    If nvm is installed correctly, your terminal responds with the version you have:

    Terminal window
    nvm --version
    v2.0.0

    Congratulations! 🎉 nvm is ready to go.

    If the command prints output like the example, congratulations! 🎉

With nvm installed, you’re ready for the main event: Node.js itself! Remember, nvm doesn’t come with a Node.js version by default, but it can install any version you want. In this guide we’ll show you how to install the most recent version labeled “long-term support,” or “LTS” for short.

  1. Open your terminal.

  2. Run the installation command.

    With version 2 and above of NVM for Windows, when you run the install command nvm automatically switches the active version to the version it just installed:

    Terminal window
    nvm install lts
    ⠹ Installing 1 version: Extracting... 4s
    Now using Node.js v24.21.0 by default.
    Installed 1 version: 24.21.0
    Completed in 7s

    If nvm isn’t recognized, go back to Check That nvm Was Installed.

Remember how npm comes bundled with Node.js? That means you just installed npm too! From now on, whenever you switch Node.js versions with nvm, npm switches right along with it.

Let’s make sure both programs were installed correctly.

To check that Node.js is correctly installed, run:

Terminal window
node --version
v24.21.0

To check that npm was installed alongside Node.js, run:

Terminal window
npm --version
11.19.0

Both commands should output a version number. Node.js and npm are separate programs, so their version numbers differ!

If you’re here, you probably found a standalone Node.js installation while checking what’s already installed, and you need to remove it before installing nvm. On Windows this step is a must. On macOS and Linux, it’s only needed if you run into weird issues or really want a clean setup.

To uninstall Node.js you should use the same method you used to install it in the first place. We’ll try to cover the most common (un)installation methods.

Node.js can be removed like any other program.

  1. Open Settings.
  2. Select Apps, then Installed apps.
  3. Find Node.js.
  4. Select Uninstall and follow the prompts.

The exact path through Settings varies between Windows versions. If yours looks different, follow the official Microsoft guide for uninstalling programs.

If you’re a Chocolatey user, you can run choco list and see if nodejs or nodejs-lts appears on the package list.

To uninstall:

  1. Open a terminal as Administrator.

  2. Run the uninstall command that matches the package in your list.

    If the package is nodejs, run:

    Terminal window
    choco uninstall nodejs

    If the package is nodejs-lts, run:

    Terminal window
    choco uninstall nodejs-lts

After uninstalling, open a new terminal and run node --version. If you see the error from earlier saying node is not recognized or not found, you did it!

Congratulations! You’ve done it! 💫 You’re now in possession of nvm, Node.js, and npm, some of the most powerful tools in your coding journey. A whole new world of possibilities has opened up before you!

Choose where to go next: