NodeJSInstall on Windows

Install on Windows

There are three good ways to install Node.js on Windows, plus a fourth (WSL2) that serious developers often prefer. The right pick depends on whether you need to switch versions and how closely you want to mirror your Linux production servers.

Which method to choose

Method

Best for

Multiple versions?

.msi installer

A quick, fixed single version

No

winget

Scriptable install, keeps the official build

No

nvm-windows

Switching versions per project

Yes

WSL2 + Unix nvm

Matching Linux servers; smoothest dev

Yes

Option 1: The official installer (.msi)
  • Go to nodejs.org and download the LTS Windows Installer (.msi).

  • Run it and accept the defaults. Keep "Add to PATH" checked — this is what makes node work in any terminal.

  • The "Tools for Native Modules" checkbox installs Python + Visual Studio Build Tools; only needed if you compile native add-ons (node-gyp).

  • Open a new PowerShell or Command Prompt window (so it picks up the new PATH) and verify.

Text
node -v
npm -v
Option 2: winget (built into Windows 10/11)

Text
winget install OpenJS.NodeJS.LTS

winget downloads and installs the official package and updates PATH automatically. Upgrade later with winget upgrade OpenJS.NodeJS.LTS.

Option 3: nvm-windows (best for multiple versions)

nvm-windows is a separate project from the Unix nvm — different code, slightly different commands — but it does the same job: install and switch Node versions per project.

  • Download nvm-setup.exe from the nvm-windows releases page and run it.

  • If you have an existing Node install, uninstall it first so the two do not fight over PATH.

  • Open a new terminal (often as Administrator the first time) and install a version.

Text
nvm install lts
nvm list
nvm use 20.11.0
nvm-windows switching needs a fresh shell context
Because it swaps a symlink (`C:\Program Files\nodejs`), `nvm use` affects *all* terminals, not just the current one — the opposite of Unix nvm. If a version change does not seem to take, close and reopen your terminal. It also has **no `.nvmrc` auto-switching**; use `fnm` or `volta` if you want that.
Option 4 (recommended): Windows Terminal + WSL2
The smoothest serious-dev path
Node development on Windows is often smoother inside **WSL2** (Windows Subsystem for Linux). You get a real Linux environment that matches your production servers, native file-system speed for `node_modules`, and the standard Unix `nvm`. Install Ubuntu from the Microsoft Store, then follow the [Linux instructions](/nodejs/install-linux).
Keep your project files inside the Linux filesystem
Under WSL2, working on files stored in `/mnt/c/...` (the Windows drive) is **dramatically slower** for Node — every `fs` call crosses the VM boundary. Keep projects in the Linux home (`~/projects`), not the mounted C: drive.
Troubleshooting

Symptom

Fix

'node' is not recognized

PATH not updated — open a new terminal or sign out/in

Old version after upgrade

Two installs on PATH; uninstall one, check where node

nvm use seems ignored

Open a fresh terminal (nvm-windows swaps a symlink)

EPERM/permission errors

Run the install terminal as Administrator once

Text
where node   # lists every node on PATH, in priority order
Verify

Text
node -e "console.log('Hello from Windows + Node')"
Hello from Windows + Node
Next
Set up your editor in [Editor & Dev Environment Setup](/nodejs/editor-setup), then write [Hello World](/nodejs/hello-world).