What you need to install npm on Windows
npm (Node Package Manager) comes bundled with Node.js, so you do not install npm separately on Windows. When you install Node.js, npm installs automatically. You download one installer from nodejs.org, run it, and both tools are ready to use.
This is the fastest route because Node.js and npm are designed to work together. You will not need to configure paths or download multiple files. After installation, you can open a command prompt and start using npm right away.
The entire process takes about five minutes. You need administrator access on your Windows machine, an internet connection to download the installer, and about 200 MB of free disk space.
Key Takeaways
- npm comes built into Node.js, so download and install Node.js from nodejs.org and npm installs at the same time.
- Choose the LTS (Long Term Support) version unless you need the latest features, because LTS versions receive security updates for longer.
- Run the installer with administrator privileges and accept the default settings unless you have a specific reason to change them.
- After installation, open a new command prompt and type npm --version to confirm npm is working.
- If npm does not work after installation, restart your computer so Windows recognizes the new paths.
Download Node.js from the official website
Go to nodejs.org in your web browser. You will see two large download buttons near the top of the page. The left button is the LTS version (currently version 20.x), and the right button is the latest version (currently version 21.x or higher). For most people, click the LTS button because it receives security updates for a longer period and is more stable for production work.
The download starts automatically. The file will be named something like node-v20.x.x-x64.msi (the exact version number changes). Wait for the download to finish before moving to the next step. Do not open the file yet.
Run the installer with administrator access
Find the downloaded file in your Downloads folder (or wherever your browser saves files). Right-click on the .msi file and select Run as administrator from the menu. Windows will ask for permission to make changes to your computer — click Yes.
The Node.js Setup Wizard window opens. Click Next to begin. Read the license agreement, check the box that says you accept the terms, and click Next again. Do not change the installation path unless you have a specific reason — the default location (usually C:\Program Files\nodejs) works for almost everyone.
Complete the installation with default settings
On the screen labeled "Custom Setup," you will see checkboxes for different components. Leave all boxes checked, including the one for npm. This ensures npm installs alongside Node.js. Click Next.
The next screen asks about tools for native modules. You can leave this unchecked unless you plan to build packages from source code (most Windows users do not need this). Click Next, then click Install. The installer copies files to your computer — this takes one to two minutes.
When the installation finishes, click Finish. Do not restart your computer yet, even if Windows suggests it.
Verify npm is working from the command prompt
Press the Windows key on your keyboard, type cmd, and press Enter. A black command prompt window opens. Type this command exactly as shown:
npm --version
Press Enter. If npm is working, you will see a version number like 10.2.3 or similar. If you see an error message like "npm is not recognized," close the command prompt, restart your computer, and try again. Windows needs to restart to recognize the new paths.
Also type this command to check Node.js:
node --version
You should see a version number like v20.10.0. Both commands should return version numbers without errors.
Troubleshooting if npm does not appear in command prompt
If you see "npm is not recognized as an internal or external command" after restarting, the installer may not have completed properly. Uninstall Node.js completely, restart your computer, and install again. To uninstall, go to Settings > Apps > Apps & features, find "Node.js" in the list, click it, and select Uninstall. Follow the prompts and restart before reinstalling.
If you installed Node.js without administrator privileges the first time, that can also cause npm to be missing. Run the installer again with administrator access (right-click and select "Run as administrator") and choose "Repair" instead of "Install" when the wizard offers that option.
Another cause is antivirus software blocking the installation. Temporarily disable your antivirus, run the installer again, and re-enable it afterward. If npm still does not work after these steps, check that you are using a command prompt (cmd.exe) and not PowerShell, which sometimes behaves differently.
Next steps after npm is installed
Once npm is working, you can start using it to download and manage packages for your projects. Create a folder for your project, open a command prompt in that folder, and type npm init to create a package.json file. This file tracks which packages your project uses.
To download a package, use the command npm install package-name (replace "package-name" with the actual package you want). npm downloads the package and all its dependencies into a folder called node_modules inside your project folder.
Frequently Asked Questions
Should I install the LTS or latest version of Node.js?
Install LTS unless you need a specific feature from the latest version. LTS versions receive security updates for three years, while the latest version only receives updates for six months. LTS is more stable for work projects and learning.
Can I install npm without installing Node.js?
No. npm only works with Node.js and is not available as a standalone download for Windows. You must install Node.js to get npm. They are designed to work together and come in the same installer.
What if I need multiple versions of Node.js on the same computer?
Use nvm-windows (Node Version Manager for Windows), a separate tool that lets you switch between different Node.js versions. Download it from github.com/coreybutler/nvm-windows and follow its instructions. This is only necessary if you work on projects that require different Node.js versions.
Do I need to restart Windows after installing Node.js?
Not always, but if npm does not work in command prompt immediately after installation, restart your computer. Windows needs to update its environment paths, and a restart ensures this happens. After restarting, open a new command prompt and try the version check again.
Is it safe to accept all the default settings during installation?
Yes. The default settings install npm, Node.js, and the necessary tools for most Windows users. You only need to change settings if you have a specific reason, like installing to a different drive or needing native module build tools for advanced development work.