How to Install npm on Windows 11

Last updated on November 17th, 2026 at 03:14 pm

npm comes with Node.js, so installing Node.js on Windows 11 installs npm too. Download the LTS Windows installer (.msi) from the Node.js download page, run it, and accept the defaults, or run winget install OpenJS.NodeJS.LTS. Then open a new Terminal window and type npm -v; a version number means npm is installed. Windows 11 Home and Pro on x64 or Arm PCs, with Node.js 24 LTS, are covered, and Windows 10 works too. On a Windows 10 PC, setting up Node.js and npm on Windows 10 covers the installer, winget and version managers.

Illustration of how to install npm on Windows 11: run the Node.js LTS installer or winget, then check the versions in Terminal
Illustration: npm comes with Node.js, so installing Node.js installs npm. Drawn for clarity, so your windows may look a little different.

What npm is

npm (Node Package Manager) installs JavaScript libraries and tools, such as React, Vite, TypeScript or ESLint, and runs project scripts. It ships with Node.js, the program that runs JavaScript outside a browser, so there’s no separate npm installer for Windows. Installing Node.js gives you node, npm and npx.

Which installation method should you use?

  • Node.js installer: the easiest choice if you’re learning or need one version of Node.js.
  • winget: the same result as the installer, from a single command.
  • nvm-windows: best if you work on several projects that need different Node.js versions. A version manager is the suggested setup for developers in Microsoft’s guide to installing Node.js on Windows.
  • WSL: install Node.js inside Linux on Windows if your project runs on Linux servers or uses Linux-only tools.

Choose the LTS (long-term support) version unless a project specifically needs the newest release. LTS versions get bug and security fixes for about three years.

Method 1: Install with the Node.js installer

  1. Go to the Node.js download page.
  2. Choose the LTS version, Windows and your processor type: x64 for most PCs or ARM64 for Snapdragon laptops. Select Windows Installer (.msi).
  3. Open the downloaded file and select Next.
  4. Accept the license and keep the default install folder.
  5. On Custom Setup, make sure npm package manager and Add to PATH are included (they are by default).
  6. The Tools for Native Modules page offers to install Python and Visual Studio build tools. Leave it cleared unless you know your project compiles native add-ons; you can install them later.
  7. Select Install, approve the User Account Control prompt, and select Finish.

Where does npm install global packages?

Run npm root -g to see the folder. With the standard installer it’s in your user profile under AppData\Roaming\npm.

Method 2: Install with winget

  1. Right-click Start and select Terminal.
  2. Run: winget install OpenJS.NodeJS.LTS
  3. Approve the User Account Control prompt.
  4. Close Terminal and open a new window so it picks up the updated PATH.

To update later, run winget upgrade OpenJS.NodeJS.LTS.

Method 3: Install with nvm-windows (for developers)

  1. Uninstall any existing Node.js from Settings > Apps > Installed apps to avoid conflicts.
  2. Download nvm-setup.exe from the nvm-windows project’s releases page on GitHub (linked from Microsoft’s guide above) and run it.
  3. Open a new Terminal window as an administrator and run nvm install lts.
  4. Run nvm use lts to switch to it. Use nvm list to see installed versions and nvm use with a version number to switch between them.

Method 4: Install npm in WSL

If your project will run on Linux servers, or uses tools that expect Linux, install Node.js inside the Windows Subsystem for Linux instead of on Windows itself.

  1. Open your Linux distribution, such as Ubuntu, from the Start menu.
  2. Install nvm for Linux by following the instructions in Microsoft’s Node.js guide linked above, then close and reopen the Ubuntu window.
  3. Run nvm install --lts, then check with node -v and npm -v.

Keep projects that use WSL inside the Linux file system (your Linux home folder) rather than on the Windows C: drive. File access across the two systems is much slower and can cause npm installs to take far longer.

Check that npm works

  1. Open a new Terminal window. Windows that were open during installation don’t see the new PATH.
  2. Run node -v. You should see a version such as v24.x.x.
  3. Run npm -v. You should see npm’s version number.

Update npm

npm sometimes releases updates between Node.js versions. To get the latest npm, open Terminal and run:

npm install -g npm@latest

Updating Node.js itself (with the installer, winget or nvm-windows) also updates npm to the version bundled with it.

Use npm for the first time

  1. Create a folder for your project, open it in File Explorer, right-click inside it and select Open in Terminal.
  2. Run npm init -y to create a package.json file.
  3. Install a package, for example npm install lodash. npm downloads it into a node_modules folder and records it in package.json.
  4. To install a command-line tool for all projects, add -g, for example npm install -g typescript.
  5. To run a tool once without installing it, use npx, for example npx create-vite@latest.

Useful npm settings and commands

  • npm config get prefix shows where global packages are installed.
  • npm list -g --depth=0 lists the global packages you’ve installed.
  • npm outdated shows which packages in a project have newer versions; npm update installs them within the ranges in package.json.
  • npm cache verify checks npm’s download cache. If installs keep failing with corrupted-file errors, npm cache clean --force clears it.
  • npm ci installs exactly what’s in a project’s lock file, which is useful when you clone someone else’s project.

npm not recognized or scripts blocked

“npm is not recognized as an internal or external command”

Windows can’t find npm on the PATH. Close every Terminal and Command Prompt window and open a new one. If it still fails, restart the PC. If that doesn’t help, reinstall Node.js and make sure Add to PATH is included.

“npm.ps1 cannot be loaded because running scripts is disabled”

PowerShell’s execution policy blocks npm’s script. Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned in PowerShell and confirm with Y. This allows local scripts for your account only. You can also use Command Prompt, which isn’t affected.

EACCES or EPERM permission errors

Another program, often antivirus or a code editor, is locking files. Close your editor, try again, and avoid installing projects inside protected folders such as C:\Program Files.

“gyp ERR!” when installing a package

The package needs to compile native code. Install the build tools: rerun the Node.js installer and select Tools for Native Modules, or install Visual Studio Build Tools with the C++ workload.

The wrong Node.js version runs

You may have two installations. Run where node to see every copy on the PATH, then uninstall the ones you don’t need.

How do I uninstall Node.js and npm?

Open Settings > Apps > Installed apps, find Node.js, and select Uninstall. Then delete the npm and npm-cache folders in AppData\Roaming and AppData\Local if you want a clean slate.

Related guides