A Step-by-Step Guide to Installing nvm-windows for Node.js Management

NVM (Node Version Manager) and nvm-windows are both version managers for Node.js, but they are designed for different operating systems and have distinct implementations:

  • NVM: Originally developed for Unix-like systems (like Linux and macOS), NVM allows users to install and manage multiple versions of Node.js. It's a bash script that modifies the PATH environment variable to switch between Node.js versions.
  • nvm-windows: Specifically designed for Windows, nvm-windows is a separate project that provides similar functionality to NVM but is built with Windows system compatibility in mind. It has a different implementation, using a symlink-based approach to manage Node.js versions, and offers a graphical user interface for version management.

This guide explains how to install and use nvm-windows.


Before installing nvm-windows, uninstall existing versions of Node.js.

Why Uninstall Node.js:

  • Version Conflicts: Having a pre-installed version of Node.js can lead to conflicts with nvm-windows. nvm-windows is designed to manage multiple Node.js versions, and a pre-existing installation outside of nvm-windows can interfere with this process.
  • Clean Slate: Uninstalling ensures that you start with a clean slate, making it easier to manage Node.js versions through nvm-windows. This helps in avoiding any unexpected behavior or errors caused by remnants of the old installation.
  • Path Management: nvm-windows manages the PATH environment variable to switch between Node.js versions. Any existing Node.js installation paths in the environment variables need to be cleared to allow nvm-windows to correctly manage these paths.

By following these steps, you ensure that nvm-windows can effectively manage your Node.js versions without interference from previous installations.

How to Uninstall Node.js:

  1. Windows Search:
    1. From the Windows Search in the task bar, search for and then click Add or remove programs.
    2. Search for "node."
    3. Click Node.js and then select Uninstall or Remove. Follow the prompts to complete the uninstallation process:
      Uninstall Node.js
  2. Check for Remaining Files:
    1. After uninstallation, check if there are any remaining Node.js files in your system. Common directories to check include:
      1. C:\Program Files\nodejs
      2. C:\Users\[Your Username]\AppData\Roaming\npm
      3. C:\Users\[Your Username]\AppData\Roaming\npm-cache
    2. If these folders still exist, delete them.
  3. Environment Variables:
    1. From the Windows Search in the task bar, search for "Environment" and then click Edit the system environment variables.
    2. In the System Properties window, click on the Environment Variables button.
    3. Check both the User and System variables for any references to Node.js or npm and remove them if found.

Install nvm-windows

  1. Go to the nvm-windows GitHub repository.
  2. Download the nvm-setup.exe file under the latest release.
  3. Run nvm-setup.exe file. This will launch the nvm-windows installer.
  4. Follow the installer prompts. It will ask you to choose the directories for installing nvm-windows and where to store the Node.js versions. You can probably accept the defaults.
  5. Once the installation is complete, restart your command prompt or terminal for the changes to take effect.
  6. To verify that nvm-windows is installed, open a new command prompt or terminal and type nvm version. This should display the version of nvm-windows you have installed.
  7. After installation, you might need to configure your system's environment variables, although the installer typically handles this.
  8. Ensure that the path to nvm-windows is added to your system's PATH environment variable. This is usually done automatically by the installer.
  9. To install a specific version of Node.js, open your command prompt or terminal and type, for example, nvm install 20.10.0 (replace 20.10.0 with the desired version).
  10. To switch between installed Node.js versions, use nvm use <version>, e.g., nvm use 20.10.0.
  11. After installing a Node.js version, you can check it by typing node -v in your command prompt or terminal. This should display the currently active Node.js version.

You should now have nvm-windows installed on your system, allowing you to manage multiple Node.js versions easily. Have fun!

Written by Nat Dunn. Follow Nat on Twitter.


Related Articles

  1. A Step-by-Step Guide to Installing nvm-windows for Node.js Management (this article)
  2. Node.js and Node Package Manager (npm)