NVM for Windows — Complete Step-by-Step Guide

This guide is only for native Windows using PowerShell / Command Prompt. It does not cover WSL or Linux.
Your current system shows:
Microsoft Windows [Version 10.0.26200.9278]
NVM for Windows v2.0.0 (Community Edition)
1. What Is NVM?
NVM (Node Version Manager) lets you install multiple Node.js versions on the same Windows PC and switch between them.
For example:
Node.js 18
Node.js 20
Node.js 22
Node.js 24
You can have all of them installed and switch between them:
nvm use 22
Then:
node -v
gives:
v22.x.x
Switch to Node 20:
nvm use 20
Now:
node -v
gives:
v20.x.x
2. Why Use NVM?
Without NVM:
Windows
↓
One Node.js installation
↓
One Node.js version
With NVM:
Windows
↓
NVM
├── Node 18
├── Node 20
├── Node 22
└── Node 24
This is particularly useful when different projects require different Node versions.
3. Check Your Current NVM Installation
You already have NVM installed.
Open PowerShell or Command Prompt and run:
nvm --version
You should see:
2.0.0
You can also run:
nvm
You should see commands such as:
install
uninstall
use
pin
list
alias
default
env
cache
config
on
off
doctor
upgrade
4. Check NVM Environment
Run:
nvm env
This shows information about NVM's environment and is useful for checking whether its paths are configured correctly.
Also run:
nvm config
This shows NVM configuration information.
5. Check Whether Node.js Is Already Installed
Run:
node -v
Then:
npm -v
Also check where Windows finds them:
where.exe node
and:
where.exe npm
If everything is working
You might see:
v22.19.0
10.x.x
and paths to the active Node installation.
If Node isn't installed
You may see:
node : The term 'node' is not recognized...
That's fine. You can install Node through NVM.
6. Check Installed Node.js Versions
Run:
nvm list
or:
nvm ls
For example:
24.0.0
* 22.19.0
20.19.4
The
*If the list is empty, you haven't installed any Node versions through NVM yet.
7. Install a Specific Node.js Version
This is one of the most important NVM commands.
To install Node 22:
nvm install 22
To install an exact version:
nvm install 22.19.0
For Node 20:
nvm install 20
For Node 24:
nvm install 24
8. Install Multiple Node.js Versions
You can install multiple versions without removing the previous ones.
For example:
nvm install 20
then:
nvm install 22
then:
nvm install 24
Check them:
nvm list
You might get:
24.0.0
22.19.0
20.19.4
All three are installed.
9. Switch to a Node.js Version
Suppose you have:
20.19.4
22.19.0
24.0.0
To use Node 22:
nvm use 22
Then verify:
node -v
You should get something like:
v22.19.0
Check npm:
npm -v
10. Switch to Another Version
Switch to Node 20:
nvm use 20
Check:
node -v
Now you should see:
v20.19.4
Switch back:
nvm use 22
Check again:
node -v
11. Use the Exact Node Version
If you have several versions installed, you can specify the exact version:
nvm use 22.19.0
Then:
node -v
Result:
v22.19.0
12. Verify Which Version Is Active
The easiest way:
node -v
You can also use:
nvm list
The active version has:
*
For example:
24.0.0
* 22.19.0
20.19.4
Therefore:
Current Node = 22.19.0
13. Understanding "Default" in NVM for Windows
Your NVM version provides:
nvm default
Use it to inspect the configured default Node version.
You should distinguish between:
nvm use 22
and:
nvm default
nvm useThe
defaultAfter making a change, always verify with:
node -v
14. Project-Specific Node Versions
NVM for Windows 2.x supports project version pinning.
Suppose your project is:
E:\portfolio
Go into it:
cd E:\portfolio
Then pin the Node version:
nvm pin 22.19.0
This creates/updates a:
.nvmrc
file.
Your project can then contain:
E:\portfolio
│
├── .nvmrc
├── package.json
├── package-lock.json
└── src
The
.nvmrc15. Why Code.nvmrc
Is Useful
.nvmrcImagine you have three projects:
Portfolio → Node 22
Old Project → Node 20
New Project → Node 24
Instead of trying to remember the version required by every project, each project can have its own
.nvmrcFor example:
portfolio\.nvmrc
could specify:
22.19.0
while another project could specify:
20.19.4
Before working on a project, you can check its
.nvmrc16. Check Your Project's Code.nvmrc
.nvmrcFrom the project directory:
Get-Content .nvmrc
For example:
22.19.0
Then:
nvm use 22.19.0
17. Node.js and npm Are Connected
When you switch Node versions:
nvm use 20
the npm version associated with that Node installation is also changed.
Check:
node -v
and:
npm -v
Then switch:
nvm use 22
and check again:
node -v
npm -v
Different Node versions can therefore have different npm versions.
18. Understanding PATH
This is extremely important.
You normally should not manually change PATH every time you switch Node versions.
NVM for Windows handles the active Node version through its own management mechanism.
Conceptually:
Windows PATH
↓
NVM-managed Node location
↓
Currently selected Node version
↓
node.exe
↓
npm
When you run:
nvm use 22
NVM changes which Node installation is active.
19. Check Your PATH
In PowerShell:
$env:Path
For an easier-to-read version:
$env:Path -split ';'
You can also check:
where.exe nvm
where.exe node
where.exe npm
These commands tell you what executable Windows is actually finding.
20. Check NVM's Environment
Run:
nvm env
This is particularly useful if:
nvm --version
works but:
node -v
doesn't.
21. Don't Manually Add Every Node Version to PATH
Suppose NVM has:
Node 20
Node 22
Node 24
Do not manually add all of these individual directories to PATH.
For example, avoid creating a PATH containing multiple Node installations like:
...\Node\v20...
...\Node\v22...
...\Node\v24...
That can cause Windows to find the wrong
node.exeInstead, let NVM control the active Node installation.
22. If You Previously Installed Node.js Normally
This is a very common source of problems.
Suppose you previously installed Node.js using the normal Windows installer.
You might have something like:
C:\Program Files\nodejs
Then later you install NVM.
Now you potentially have:
Normal Node.js
+
NVM-managed Node.js
This can cause:
node -v
to return a different version than:
nvm use 22
expects.
Check:
where.exe node
If you see an old standalone Node installation before your NVM-managed location, investigate that installation.
23. Check for Multiple Node Installations
Run:
where.exe node
and:
where.exe npm
If multiple locations appear, Windows may have more than one Node installation available.
For example:
C:\Program Files\nodejs\node.exe
C:\Users\...\AppData\...\node.exe
This is something to fix if the wrong version is being selected.
24. NVM Doctor
NVM for Windows 2.x provides a useful diagnostic command:
nvm doctor
Run this when you have problems with:
-
not being recognizedCode
node -
not being recognizedCode
npm -
PATH
-
NVM configuration
-
Node switching
-
conflicting installations
After running it, follow the issues it reports.
Then test:
nvm list
nvm use 22
node -v
npm -v
25. Enable NVM
Your version provides:
nvm on
This enables NVM's Node management.
Then:
nvm use 22
and:
node -v
26. Disable NVM
You can disable NVM's Node management with:
nvm off
Then Node management through NVM is stopped.
To enable it again:
nvm on
If you use this while troubleshooting, verify the result with:
nvm env
and:
where.exe node
27. Uninstall a Node.js Version
First check what you have:
nvm list
Suppose you have:
* 22.19.0
20.19.4
18.20.8
To remove Node 18:
nvm uninstall 18.20.8
Then:
nvm list
You should now see:
* 22.19.0
20.19.4
28. Don't Remove the Node Version You're Currently Using
Suppose:
* 22.19.0
20.19.4
You're currently using Node 22.
Switch first:
nvm use 20.19.4
Then remove Node 22:
nvm uninstall 22.19.0
29. Remove All Node Versions
If you want to start fresh:
nvm list
Then uninstall each installed version:
nvm uninstall 18.20.8
nvm uninstall 20.19.4
nvm uninstall 22.19.0
Check:
nvm list
You should have no unwanted Node versions remaining.
30. Uninstall NVM Completely
If you want to remove NVM for Windows itself:
Step 1 — Check what is installed
nvm list
Step 2 — Remove Node versions you don't need
nvm uninstall <version>
Step 3 — Uninstall NVM
Go to:
Windows Settings
↓
Apps
↓
Installed apps
↓
NVM for Windows
↓
Uninstall
Follow the uninstall wizard.
31. Clean Up Environment Variables
After uninstalling NVM, check:
where.exe nvm
where.exe node
where.exe npm
If they still point to old installations, open:
Start
↓
Search "Environment Variables"
↓
Edit the system environment variables
↓
Environment Variables
Check both:
User variables
and:
System variables
Look for old NVM/Node-related entries.
Remove only entries belonging to installations you have actually removed.
32. Restart PowerShell After PATH Changes
This is important.
After changing environment variables:
-
Close PowerShell.
-
Close Command Prompt.
-
Open a new PowerShell window.
Then:
nvm --version
node -v
npm -v
Environment-variable changes may not appear in an already-open terminal.
33. Upgrade NVM
Your NVM version provides:
nvm upgrade
Before upgrading, you can check:
nvm --version
Then:
nvm upgrade
Afterward:
nvm --version
34. NVM Cache
NVM also provides:
nvm cache
You can use:
nvm cache --help
to see the cache-management commands supported by your installed version.
The cache can contain downloaded Node.js installation files.
35. NVM Configuration
Check configuration:
nvm config
For detailed help:
nvm config --help
This is useful when you need to investigate where NVM stores/manages its files.
36. Complete Fresh Setup
If you're setting up NVM from scratch, here's the clean sequence I'd recommend.
Step 1
Install NVM for Windows.
Step 2
Open a new PowerShell.
Step 3
Check NVM:
nvm --version
Step 4
Check the environment:
nvm env
Step 5
Run diagnostics:
nvm doctor
Step 6
Install your desired Node version:
nvm install 22
Step 7
Activate it:
nvm use 22
Step 8
Verify Node:
node -v
Step 9
Verify npm:
npm -v
Step 10
Check Windows executable resolution:
where.exe node
where.exe npm
Step 11
Check installed versions:
nvm list
At this point your Node environment should be ready.
37. Recommended Setup for Your CodeE:\portfolio
Project
E:\portfolioFor your portfolio project, you could do:
cd E:\portfolio
Check Node:
node -v
Check whether the project has an
.nvmrcTest-Path .nvmrc
If it exists:
Get-Content .nvmrc
Then use the required version:
nvm use <version>
For example:
nvm use 22
Then:
node -v
npm -v
Finally:
npm install
and:
npm run dev
38. If Codenpm
Is Not Recognized
npmIf you get:
npm : The term 'npm' is not recognized...
don't immediately reinstall everything.
Run these commands in order:
nvm --version
nvm list
nvm env
nvm doctor
Then activate your Node version:
nvm use 22
Check:
node -v
Then:
npm -v
If it still fails:
where.exe node
where.exe npm
and:
$env:Path -split ';'
This will tell you whether the problem is NVM, Node installation, or PATH.
39. If Codenvm
Works but Codenode
Doesn't
nvmnodeThis situation:
nvm --version
works:
2.0.0
but:
node -v
doesn't work.
Do:
nvm list
If you have no Node version installed:
nvm install 22
Then:
nvm use 22
Then:
node -v
If Node is installed but still isn't found:
nvm env
nvm doctor
where.exe node
40. If Codenvm use
Works but the Wrong Node Version Appears
nvm useFor example:
nvm use 22
but:
node -v
shows:
v20.x.x
Run:
where.exe node
If Windows finds a different Node installation first, you probably have a PATH conflict.
Also run:
nvm env
and:
nvm doctor
Do not randomly add more Node paths to PATH. The goal is to have NVM control which Node installation is active.
41. Complete Command Cheat Sheet
# NVM version
nvm --version
# NVM help
nvm
# Install Node
nvm install 22
# Install exact Node version
nvm install 22.19.0
# List installed Node versions
nvm list
# Switch Node version
nvm use 22
# Switch to exact version
nvm use 22.19.0
# Show default
nvm default
# Pin project Node version
nvm pin 22.19.0
# Uninstall Node version
nvm uninstall 20.19.4
# NVM environment
nvm env
# NVM configuration
nvm config
# NVM diagnostics
nvm doctor
# Enable NVM
nvm on
# Disable NVM
nvm off
# NVM cache
nvm cache
# Upgrade NVM
nvm upgrade
# Node version
node -v
# npm version
npm -v
# Find Node executable
where.exe node
# Find npm executable
where.exe npm
# Find NVM executable
where.exe nvm
# Show PATH
$env:Path
# Show PATH line by line
$env:Path -split ';'
42. The Simple Mental Model
Think of NVM like this:
WINDOWS
│
▼
NVM for Windows
│
┌────────────┼────────────┐
▼ ▼ ▼
Node 20 Node 22 Node 24
│ │ │
└────────────┼────────────┘
│
nvm use 22
│
▼
node.exe
│
▼
npm
You install versions:
nvm install 20
nvm install 22
nvm install 24
You switch versions:
nvm use 22
You check versions:
nvm list
node -v
npm -v
You remove versions:
nvm uninstall 20
You diagnose problems:
nvm doctor
And you generally let NVM manage PATH rather than manually adding every Node version to PATH.
43. Recommended Final Configuration
For a normal Windows development machine, I'd keep it simple:
Windows
│
├── PowerShell
├── Git
├── VS Code
│
└── NVM for Windows
│
├── Node 20.x ← older projects
├── Node 22.x ← primary development
└── Node 24.x ← newer projects
Then your normal workflow becomes:
nvm list
nvm use 22
node -v
npm -v
cd E:\portfolio
npm install
npm run dev
That's the whole point of NVM: install Node versions once, switch between them when needed, and let NVM handle the active Node environment.