How to Install npm on Windows: A Complete Setup Guide

If you're getting into JavaScript development, Node.js projects, or modern front-end frameworks, npm (Node Package Manager) is one of the first tools you'll need on your machine. Here's exactly how to get it running on Windows — and what to consider based on your setup.

What Is npm and Why Does It Come With Node.js?

npm is the default package manager for the Node.js runtime environment. It lets you install, update, and manage JavaScript libraries and tools — everything from React and Express to build utilities like Webpack or ESLint.

The key thing to understand: npm doesn't install separately on Windows. It ships bundled with Node.js. When you install Node.js, npm comes along automatically. This means the installation path is really about getting Node.js onto your system correctly.

Method 1: Install npm via the Node.js Installer (Most Common)

This is the straightforward route and works well for most developers. 🖥️

Steps:

  1. Go to nodejs.org and download the Windows installer (.msi file)
  2. Choose between the LTS (Long Term Support) version or the Current version — more on this distinction below
  3. Run the installer and follow the setup wizard
  4. Accept the default installation path unless you have a specific reason to change it
  5. When prompted, check the box to automatically install necessary tools — this includes Chocolatey and build tools for native modules
  6. Once installation completes, open Command Prompt or PowerShell and verify with:
node -v npm -v 

Both commands should return version numbers. If they do, npm is installed and ready.

Method 2: Install via nvm-windows (Recommended for Developers Managing Multiple Projects)

nvm-windows (Node Version Manager for Windows) is a separate tool that lets you install and switch between multiple versions of Node.js — and by extension, multiple versions of npm.

This approach suits developers who:

  • Work on multiple projects requiring different Node.js versions
  • Need to test compatibility across environments
  • Want cleaner control over upgrades and rollbacks

Steps:

  1. Download the latest release of nvm-windows from its GitHub repository
  2. Run the installer (nvm-setup.exe)
  3. After installation, open a new terminal window and run:
nvm install lts nvm use lts 
  1. Verify with node -v and npm -v as before

One important note: nvm-windows is a separate project from the Unix-based nvm — they're not the same tool and aren't cross-compatible. Don't install both; pick one approach and stick with it.

LTS vs. Current: Which Node.js Version Should You Install?

Version TypeStabilitynpm VersionBest For
LTSHigh — longer support cycleSlightly older but stableProduction apps, learning, most projects
CurrentLatest features, less testedMost recent releaseExperimenting, cutting-edge tooling

For most Windows users, LTS is the safer default. Active LTS releases receive security patches and bug fixes for an extended period, reducing the chance of breaking changes in your workflow.

Common Issues After Installation on Windows

npm Not Recognized in Command Prompt

If you see 'npm' is not recognized as an internal or external command, the most likely cause is a PATH variable issue. The Node.js installer should add npm to your system PATH automatically, but occasionally it doesn't register until you:

  • Restart your terminal or open a new session
  • Restart Windows entirely
  • Manually add the Node.js installation folder to your system environment variables

Permission Errors When Installing Global Packages

Windows sometimes restricts write access to certain directories. If you run into EACCES or access-denied errors when using npm install -g, the solution usually involves either running your terminal as Administrator or changing npm's global package directory to a user-writable location.

Firewall or Corporate Network Blocking npm

In managed enterprise environments, npm's registry at registry.npmjs.org may be blocked or proxied. Your IT team can configure a private npm registry or set proxy settings using npm config set proxy.

Your Skill Level and Use Case Change the Right Approach 🛠️

The direct Node.js installer is fast and beginner-friendly. You get npm running in under five minutes with minimal configuration. For someone learning JavaScript or building a single project, this is entirely sufficient.

The nvm-windows route adds complexity upfront but pays off if you're managing long-term development work, collaborating on teams with different Node.js version requirements, or maintaining legacy applications alongside newer ones.

Your Windows version also plays a small role — Windows 10 and 11 handle the Node.js installer without issues, but older versions of Windows may encounter compatibility gaps with newer Node.js releases. If you're on an older OS, the LTS version of Node.js is more likely to support it than the Current release.

PowerShell execution policy is another Windows-specific variable. Some npm scripts and tools require PowerShell to run scripts, and Windows defaults to a restricted policy. You may need to adjust this with Set-ExecutionPolicy depending on what you're building.

The right setup depends on how many projects you're juggling, how often you expect to update Node.js, and how much overhead you're comfortable managing in your development environment.