How to Install NVM in Windows
![How to Install NVM in Windows](/images/install-nvm-windows/images/hero.png)
Node Version Manager (NVM) is a handy tool for managing multiple Node.js versions. While NVM was initially designed for Unix-based systems, a Windows-compatible version, nvm-windows, is available. This guide will show you how to install nvm-windows step-by-step.
Key Takeaways
- nvm-windows makes it easy to manage multiple Node.js versions on Windows.
- Installation requires downloading the correct package and configuring your environment.
- Follow these steps to set up and verify your installation successfully.
Prerequisites
Before installing nvm-windows, ensure you have the following:
- A Windows machine running Windows 10 or higher.
- Administrator access to install programs.
- No existing Node.js installation (uninstall if already installed).
Step 1: Download the NVM-Windows Installer
- Visit the official nvm-windows GitHub page.
- Scroll to the latest release and download the
nvm-setup.exe
file.
Step 2: Run the Installer
- Locate the downloaded
nvm-setup.exe
file and double-click it. - Follow the installation wizard:
- Accept the license agreement.
- Choose the installation directory (default is
C:\Program Files\nvm
). - Specify a directory for Node.js installations (default is
C:\Program Files\nodejs
).
Step 3: Verify the Installation
After installation, verify that nvm-windows was installed correctly:
- Open a new Command Prompt or PowerShell window.
- Type the following command:
nvm version
You should see the installed nvm version. If the command is not recognized, ensure the installation directory is in your system’s PATH
environment variable.
Step 4: Install and Use Node.js Versions
With nvm-windows installed, you can now install and manage Node.js versions:
- Install a specific Node.js version (e.g., 16.14.0):
nvm install 16.14.0
- Switch to the installed version:
nvm use 16.14.0
- Verify the active Node.js version:
node -v
Conclusion
Installing nvm-windows is a straightforward process that simplifies managing multiple Node.js versions. Follow the steps above to install, verify, and start using it effectively for your projects.
FAQs
Ensure the NVM installation directory is added to your system's `PATH` variable. Reopen Command Prompt or PowerShell after fixing it.
It's not recommended. Uninstall any pre-existing Node.js version before using **nvm-windows** to avoid conflicts.
No, **nvm-windows** works in native Windows environments. For WSL, use the original NVM for Unix systems.