How to Install Node.js and npm on Windows

A minimalist green hexagon with a yellow downward arrow landing inside a computer window frame. Text: NODE.JS ON WINDOWS

You need Node.js on your Windows machine, a tutorial told you to run npm install, and the download page offers more choices than answers. This DevAnswers guide installs Node.js and npm on Windows 10 or 11 three ways, the installer, winget, and nvm-windows, explains which to pick and which version (LTS or Current), and fixes the two errors that catch almost every first-time Windows install.

Quick Answer: Install Node.js LTS in Two Minutes 

  1. Download the LTS Windows installer (.msi) from nodejs.org and run it, accepting the defaults.
  2. Open a new PowerShell window (existing ones do not see the updated PATH).
  3. Verify both tools:
PowerShell
node -v
npm -v

There is no separate npm install: npm is the package manager for Node.js and it is installed alongside Node. If both commands print versions, you are done; the rest of this guide is for choosing versions and methods, and for when something does not print a version.

Which Method and Which Version? 

You are…UseWhy
Installing Node for one project or toolThe MSI installer or wingetOne system-wide Node, zero moving parts
Comfortable in the terminal, want scripted installswingetOne command, upgrades via winget upgrade
A developer juggling multiple projectsnvm-windowsInstall several Node versions, switch per project

On versions: as of mid-2026, Node.js 24 is the Active LTS line and Node.js 26 is Current. LTS is the answer for production and for most people; Current is for trying the newest features and moves fast. The scheme itself is changing: through Node 26, odd-numbered releases (like 25) go unsupported after about six months while even-numbered ones become LTS, and starting with Node 27 the project moves to an annual cycle in which every major version reaches LTS. TL;DR: when in doubt, install LTS.

Method 1: The Windows Installer (MSI) 

The classic route, and the right one for most single-version setups:

  1. On the nodejs.org download page, pick the LTS Windows installer (.msi, 64-bit).
  2. Run it. The defaults are correct for almost everyone, and the installer adds Node to your PATH.
  3. One wizard screen offers to automatically install the necessary tools for native modules (Python and the Visual Studio Build Tools). Most people should leave it unticked; you only need it for npm packages that compile C/C++ during install, and you can add the tools later if a package demands them.
  4. Finish, then open a new terminal and verify with node -v and npm -v.

Method 2: winget (Command-Line Install) 

Windows 11 and current Windows 10 builds ship with the winget package manager, which turns the install into one line in PowerShell. If winget is not recognized on your machine (older Windows 10 builds and some restricted environments), update App Installer from the Microsoft Store, or simply use Method 1:

PowerShell
winget install OpenJS.NodeJS.LTS

Swap OpenJS.NodeJS.LTS for OpenJS.NodeJS if you want the Current line instead. Upgrading later is the standard winget flow:

PowerShell
winget upgrade OpenJS.NodeJS.LTS

As with the MSI, open a new terminal afterwards before verifying; winget installs update the PATH, but the window you ran the install from keeps its old environment.

Method 3: nvm-windows (Multiple Node Versions) 

Projects age at different speeds, and sooner or later one of them needs an older Node than the rest. That is what a version manager solves, and Microsoft’s own Windows development docs walk developers through nvm-windows for exactly this job. Note the name: it is a separate project from the Linux/macOS nvm, purpose-built for Windows.

Uninstall any existing Node.js (Settings › Apps) before installing nvm-windows. A system-wide Node from the MSI or winget fights with the version manager over which node your PATH finds, and the losers are you and your build.
  1. Download nvm-setup.exe from the latest nvm-windows release and run it.
  2. Open a new PowerShell window as Administrator (nvm-windows switches versions via a symlink in Program Files, which needs elevation) and install the LTS release: nvm install lts
  3. See what installed with nvm list, then activate that exact version: nvm use <version>, substituting the number the list shows (for example nvm use 24.4.1).
  4. Confirm: nvm list now marks the active version, and node -v answers.

From here, nvm install any other version a project needs and nvm use to switch between them in seconds.

Verify: Run Your First Node Script 

Version numbers prove the install; a running script proves the toolchain. In a PowerShell window (the Set-Content line is PowerShell-specific), in any folder:

PowerShell
Set-Content hello.js 'console.log("Node on Windows says hello via DevAnswers")'
node hello.js
Output
Node on Windows says hello via DevAnswers

And the npm half, creating a project and pulling in one package:

PowerShell
npm init -y
npm install cowsay

If a node_modules folder and a package-lock.json appear, npm is downloading and installing packages correctly, and every Node tutorial on the internet is now open to you.

Troubleshooting 

  • ‘node’ is not recognized as an internal or external command. Nine times out of ten you are in the same terminal you installed from: the installer updated the PATH, but open windows keep their old environment, so open a new terminal (or sign out and in). If a fresh window still fails, confirm node.exe exists in C:\Program Files\nodejs, and that this folder is in your PATH (Settings › System › About › Advanced system settings › Environment Variables). Add it if missing, then open another new terminal.
  • npm.ps1 cannot be loaded because running scripts is disabled on this system. PowerShell’s execution policy, a safety feature controlling which scripts load, is blocking npm’s PowerShell wrapper. The standard fix allows locally-created scripts for your user only:
PowerShell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Answer Y, open a new PowerShell window, and npm works. RemoteSigned still requires downloaded scripts to be signed, so it is the sensible middle ground rather than an off switch. If you cannot change policy (a locked-down work machine), npm.cmd bypasses the PowerShell wrapper, and plain Command Prompt is unaffected.

Next Steps 

Node and npm are installed, verified with a real script, and the two classic Windows traps are behind you.

Support DevAnswers
Written, tested and maintained by one developer. Your support keeps these guides accurate and ad-light.
Buy me a coffee

Comments

Leave a reply