NVM for Windows — Complete Step-by-Step Guide

#Node.js#nvm#Node JS Development
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:

text
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:

text
Node.js 18
Node.js 20
Node.js 22
Node.js 24

You can have all of them installed and switch between them:

powershell
nvm use 22

Then:

powershell
node -v

gives:

text
v22.x.x

Switch to Node 20:

powershell
nvm use 20

Now:

powershell
node -v

gives:

text
v20.x.x

2. Why Use NVM?

Without NVM:

text
Windows
   ↓
One Node.js installation
   ↓
One Node.js version

With NVM:

text
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:

powershell
nvm --version

You should see:

text
2.0.0

You can also run:

powershell
nvm

You should see commands such as:

text
install
uninstall
use
pin
list
alias
default
env
cache
config
on
off
doctor
upgrade

4. Check NVM Environment

Run:

powershell
nvm env

This shows information about NVM's environment and is useful for checking whether its paths are configured correctly.

Also run:

powershell
nvm config

This shows NVM configuration information.


5. Check Whether Node.js Is Already Installed

Run:

powershell
node -v

Then:

powershell
npm -v

Also check where Windows finds them:

powershell
where.exe node

and:

powershell
where.exe npm

If everything is working

You might see:

text
v22.19.0
10.x.x

and paths to the active Node installation.

If Node isn't installed

You may see:

text
node : The term 'node' is not recognized...

That's fine. You can install Node through NVM.


6. Check Installed Node.js Versions

Run:

powershell
nvm list

or:

powershell
nvm ls

For example:

text
  24.0.0
* 22.19.0
  20.19.4

The

Code
*
means that version is currently active.

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:

powershell
nvm install 22

To install an exact version:

powershell
nvm install 22.19.0

For Node 20:

powershell
nvm install 20

For Node 24:

powershell
nvm install 24

8. Install Multiple Node.js Versions

You can install multiple versions without removing the previous ones.

For example:

powershell
nvm install 20

then:

powershell
nvm install 22

then:

powershell
nvm install 24

Check them:

powershell
nvm list

You might get:

text
  24.0.0
  22.19.0
  20.19.4

All three are installed.


9. Switch to a Node.js Version

Suppose you have:

text
20.19.4
22.19.0
24.0.0

To use Node 22:

powershell
nvm use 22

Then verify:

powershell
node -v

You should get something like:

text
v22.19.0

Check npm:

powershell
npm -v

10. Switch to Another Version

Switch to Node 20:

powershell
nvm use 20

Check:

powershell
node -v

Now you should see:

text
v20.19.4

Switch back:

powershell
nvm use 22

Check again:

powershell
node -v

11. Use the Exact Node Version

If you have several versions installed, you can specify the exact version:

powershell
nvm use 22.19.0

Then:

powershell
node -v

Result:

text
v22.19.0

12. Verify Which Version Is Active

The easiest way:

powershell
node -v

You can also use:

powershell
nvm list

The active version has:

text
*

For example:

text
  24.0.0
* 22.19.0
  20.19.4

Therefore:

text
Current Node = 22.19.0

13. Understanding "Default" in NVM for Windows

Your NVM version provides:

powershell
nvm default

Use it to inspect the configured default Node version.

You should distinguish between:

powershell
nvm use 22

and:

powershell
nvm default

Code
nvm use
changes which Node version NVM is currently managing.

The

Code
default
command is specifically provided by your NVM for Windows 2.x installation for default-version management.

After making a change, always verify with:

powershell
node -v

14. Project-Specific Node Versions

NVM for Windows 2.x supports project version pinning.

Suppose your project is:

text
E:\portfolio

Go into it:

powershell
cd E:\portfolio

Then pin the Node version:

powershell
nvm pin 22.19.0

This creates/updates a:

text
.nvmrc

file.

Your project can then contain:

text
E:\portfolio
│
├── .nvmrc
├── package.json
├── package-lock.json
└── src

The

Code
.nvmrc
specifies the Node version expected by that project.


15. Why
Code
.nvmrc
Is Useful

Imagine you have three projects:

text
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

Code
.nvmrc
.

For example:

text
portfolio\.nvmrc

could specify:

text
22.19.0

while another project could specify:

text
20.19.4

Before working on a project, you can check its

Code
.nvmrc
and switch to the appropriate version.


16. Check Your Project's
Code
.nvmrc

From the project directory:

powershell
Get-Content .nvmrc

For example:

text
22.19.0

Then:

powershell
nvm use 22.19.0

17. Node.js and npm Are Connected

When you switch Node versions:

powershell
nvm use 20

the npm version associated with that Node installation is also changed.

Check:

powershell
node -v

and:

powershell
npm -v

Then switch:

powershell
nvm use 22

and check again:

powershell
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:

text
Windows PATH
     ↓
NVM-managed Node location
     ↓
Currently selected Node version
     ↓
node.exe
     ↓
npm

When you run:

powershell
nvm use 22

NVM changes which Node installation is active.


19. Check Your PATH

In PowerShell:

powershell
$env:Path

For an easier-to-read version:

powershell
$env:Path -split ';'

You can also check:

powershell
where.exe nvm
powershell
where.exe node
powershell
where.exe npm

These commands tell you what executable Windows is actually finding.


20. Check NVM's Environment

Run:

powershell
nvm env

This is particularly useful if:

powershell
nvm --version

works but:

powershell
node -v

doesn't.


21. Don't Manually Add Every Node Version to PATH

Suppose NVM has:

text
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:

text
...\Node\v20...
...\Node\v22...
...\Node\v24...

That can cause Windows to find the wrong

Code
node.exe
.

Instead, 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:

text
C:\Program Files\nodejs

Then later you install NVM.

Now you potentially have:

text
Normal Node.js
        +
NVM-managed Node.js

This can cause:

text
node -v

to return a different version than:

text
nvm use 22

expects.

Check:

powershell
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:

powershell
where.exe node

and:

powershell
where.exe npm

If multiple locations appear, Windows may have more than one Node installation available.

For example:

text
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:

powershell
nvm doctor

Run this when you have problems with:

  • Code
    node
    not being recognized

  • Code
    npm
    not being recognized

  • PATH

  • NVM configuration

  • Node switching

  • conflicting installations

After running it, follow the issues it reports.

Then test:

powershell
nvm list
powershell
nvm use 22
powershell
node -v
powershell
npm -v

25. Enable NVM

Your version provides:

powershell
nvm on

This enables NVM's Node management.

Then:

powershell
nvm use 22

and:

powershell
node -v

26. Disable NVM

You can disable NVM's Node management with:

powershell
nvm off

Then Node management through NVM is stopped.

To enable it again:

powershell
nvm on

If you use this while troubleshooting, verify the result with:

powershell
nvm env

and:

powershell
where.exe node

27. Uninstall a Node.js Version

First check what you have:

powershell
nvm list

Suppose you have:

text
* 22.19.0
  20.19.4
  18.20.8

To remove Node 18:

powershell
nvm uninstall 18.20.8

Then:

powershell
nvm list

You should now see:

text
* 22.19.0
  20.19.4

28. Don't Remove the Node Version You're Currently Using

Suppose:

text
* 22.19.0
  20.19.4

You're currently using Node 22.

Switch first:

powershell
nvm use 20.19.4

Then remove Node 22:

powershell
nvm uninstall 22.19.0

29. Remove All Node Versions

If you want to start fresh:

powershell
nvm list

Then uninstall each installed version:

powershell
nvm uninstall 18.20.8
nvm uninstall 20.19.4
nvm uninstall 22.19.0

Check:

powershell
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

powershell
nvm list

Step 2 — Remove Node versions you don't need

powershell
nvm uninstall <version>

Step 3 — Uninstall NVM

Go to:

text
Windows Settings
        ↓
Apps
        ↓
Installed apps
        ↓
NVM for Windows
        ↓
Uninstall

Follow the uninstall wizard.


31. Clean Up Environment Variables

After uninstalling NVM, check:

powershell
where.exe nvm
powershell
where.exe node
powershell
where.exe npm

If they still point to old installations, open:

text
Start
↓
Search "Environment Variables"
↓
Edit the system environment variables
↓
Environment Variables

Check both:

text
User variables

and:

text
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:

  1. Close PowerShell.

  2. Close Command Prompt.

  3. Open a new PowerShell window.

Then:

powershell
nvm --version
powershell
node -v
powershell
npm -v

Environment-variable changes may not appear in an already-open terminal.


33. Upgrade NVM

Your NVM version provides:

powershell
nvm upgrade

Before upgrading, you can check:

powershell
nvm --version

Then:

powershell
nvm upgrade

Afterward:

powershell
nvm --version

34. NVM Cache

NVM also provides:

powershell
nvm cache

You can use:

powershell
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:

powershell
nvm config

For detailed help:

powershell
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:

powershell
nvm --version

Step 4

Check the environment:

powershell
nvm env

Step 5

Run diagnostics:

powershell
nvm doctor

Step 6

Install your desired Node version:

powershell
nvm install 22

Step 7

Activate it:

powershell
nvm use 22

Step 8

Verify Node:

powershell
node -v

Step 9

Verify npm:

powershell
npm -v

Step 10

Check Windows executable resolution:

powershell
where.exe node
powershell
where.exe npm

Step 11

Check installed versions:

powershell
nvm list

At this point your Node environment should be ready.


37. Recommended Setup for Your
Code
E:\portfolio
Project

For your portfolio project, you could do:

powershell
cd E:\portfolio

Check Node:

powershell
node -v

Check whether the project has an

Code
.nvmrc
:

powershell
Test-Path .nvmrc

If it exists:

powershell
Get-Content .nvmrc

Then use the required version:

powershell
nvm use <version>

For example:

powershell
nvm use 22

Then:

powershell
node -v
npm -v

Finally:

powershell
npm install

and:

powershell
npm run dev

38. If
Code
npm
Is Not Recognized

If you get:

text
npm : The term 'npm' is not recognized...

don't immediately reinstall everything.

Run these commands in order:

powershell
nvm --version
powershell
nvm list
powershell
nvm env
powershell
nvm doctor

Then activate your Node version:

powershell
nvm use 22

Check:

powershell
node -v

Then:

powershell
npm -v

If it still fails:

powershell
where.exe node
powershell
where.exe npm

and:

powershell
$env:Path -split ';'

This will tell you whether the problem is NVM, Node installation, or PATH.


39. If
Code
nvm
Works but
Code
node
Doesn't

This situation:

powershell
nvm --version

works:

text
2.0.0

but:

powershell
node -v

doesn't work.

Do:

powershell
nvm list

If you have no Node version installed:

powershell
nvm install 22

Then:

powershell
nvm use 22

Then:

powershell
node -v

If Node is installed but still isn't found:

powershell
nvm env
powershell
nvm doctor
powershell
where.exe node

40. If
Code
nvm use
Works but the Wrong Node Version Appears

For example:

powershell
nvm use 22

but:

powershell
node -v

shows:

text
v20.x.x

Run:

powershell
where.exe node

If Windows finds a different Node installation first, you probably have a PATH conflict.

Also run:

powershell
nvm env

and:

powershell
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

powershell
# 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:

text
                 WINDOWS
                    │
                    ▼
              NVM for Windows
                    │
       ┌────────────┼────────────┐
       ▼            ▼            ▼
    Node 20       Node 22      Node 24
       │            │            │
       └────────────┼────────────┘
                    │
              nvm use 22
                    │
                    ▼
                node.exe
                    │
                    ▼
                  npm

You install versions:

powershell
nvm install 20
nvm install 22
nvm install 24

You switch versions:

powershell
nvm use 22

You check versions:

powershell
nvm list
node -v
npm -v

You remove versions:

powershell
nvm uninstall 20

You diagnose problems:

powershell
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:

text
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:

powershell
nvm list
powershell
nvm use 22
powershell
node -v
npm -v
powershell
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.