How to Install npm on Windows 11

To install npm on Windows 11, install Node.js, because npm is included with it. Go to the Node.js download page, download the LTS Windows installer (.msi), run it, and accept the defaults. Then open a new Terminal window and type npm -v. If a version number appears, npm is installed. You can also install it with one command: winget install OpenJS.NodeJS.LTS.

Applies to: Windows 11 Home and Pro on x64 and Arm PCs, with Node.js 24 LTS. The steps also work in Windows 10. Last reviewed October 7, 2026.

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. This is a drawing, not a screenshot.

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. Microsoft recommends a version manager for developers in its 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.

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.

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.

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. Install WSL if you haven’t already. See how to install WSL on Windows 11.
  2. Open your Linux distribution, such as Ubuntu, from the Start menu.
  3. Install nvm for Linux by following the instructions in Microsoft’s Node.js guide linked above, then close and reopen the Ubuntu window.
  4. 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.

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.

Troubleshooting

“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.

Frequently asked questions

Can I install npm without Node.js?

No. npm needs Node.js to run, so the official way to get npm on Windows is to install Node.js.

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.

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.

What other developer tools should I install?

Most JavaScript projects also need Git. See how to install Git on Windows 11.

Related: How to install Python IDLE in Windows 10.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy