To install npm on windows just unzip the npm archive where node is. See the docs for more detail.

npm is shipped with node, that is how you should install it. nvm is only for changing node versions and does not install npm. A cleaner way to use npm and nvm is to first install node as it is (with npm), then install the nvm package by npm install nvm

Answer from user568109 on Stack Overflow

To install npm on windows just unzip the npm archive where node is. See the docs for more detail.

npm is shipped with node, that is how you should install it. nvm is only for changing node versions and does not install npm. A cleaner way to use npm and nvm is to first install node as it is (with npm), then install the nvm package by npm install nvm

Answer from user568109 on Stack Overflow
🌐
npm
docs.npmjs.com › downloading-and-installing-node-js-and-npm
Downloading and installing Node.js and npm | npm Docs
Note: to download the latest version of npm, on the command line, run the following command:npm install -g npm ... To see if you already have Node.js and npm installed and check the installed version, run the following commands:
🌐
Node.js
nodejs.org › en › download
Node.js — Download Node.js®
with npm · InfoWant new features sooner? Get the latest Node.js version instead and try the latest improvements! BashCopy to clipboard and their installation scripts are not maintained by the Node.js project. If you encounter any issues please visit 's website ·
Discussions

Linux: Best way to install node & npm
my preferred options. firstly, do not install from apt, it gets too old of versions instead, go to https://github.com/nodesource/distributions#debian-and-ubuntu-based-distributions which gives you a new apt repository, and then you can install from apt or, just use nvm ( https://github.com/nvm-sh/nvm ) or fnm ( https://github.com/Schniz/fnm ). fnm is nice because it does not lag shell startup as much as nvm. these latter two options may be better for dev than production, just since it is mostly installed to your local environment More on reddit.com
🌐 r/node
13
1
December 8, 2022
Are you supposed to run 'npm install' as root?
the easiest way to setup node and not need to use 'sudo', is to use something like nvm - https://github.com/creationix/nvm or n - https://github.com/tj/n Lets you run have multiple versions of node installed and be able to switch between them, but also installs it in a way where you don't need to use sudo. More on reddit.com
🌐 r/node
7
4
December 7, 2018
What's the best way to install the newest npm and node on my friend's linux mint pc?
Using nvm is usually painless. More on reddit.com
🌐 r/node
10
2
December 28, 2021
Im losing it. How did you all install node.js , npm and so on? locally or global?
Easiest way? Just install nvm . It manges your node and npm version with one command. Also, it's best to use node and npm without sudo. Remember to make sure the entries in your .bashrc, .zshrc, etc are correct. Info: Installing node globally means you have access to in at all times. Locally means only the project folder you're working in. You want both node and npm installed globally to access them in all your projects (at least that's how I prefer it). More on reddit.com
🌐 r/linuxquestions
11
2
March 23, 2023
People also ask

What is the use of npm install?
The primary use of npm install is to save any specified packages into dependencies by default.
🌐
radixweb.com
radixweb.com › blog › installing-npm-and-nodejs-on-windows-and-mac
How to Install NPM and Node.js on Windows and Mac Devices?
How to install npm in terminal?
To install npm, open terminal,sudo apt install nodejs //to install Nodejs,node -v or node –version //to verify installation of Node.js,sudo apt install npm //to install npm,npm -v or npm –version //to verify installation of npm
🌐
radixweb.com
radixweb.com › blog › installing-npm-and-nodejs-on-windows-and-mac
How to Install NPM and Node.js on Windows and Mac Devices?
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › javascript › nodejs-on-windows
Set up Node.js on native Windows | Microsoft Learn
Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node.js, but is only available for Mac/Linux and not supported on Windows. Instead, we recommend installing nvm-windows and then using it to install Node.js and Node Package Manager (npm).
Find elsewhere
🌐
W3Schools
w3schools.com › nodejs › nodejs_npm.asp
Node.js NPM
Modules are JavaScript libraries you can include in your project. Downloading a package is very easy. Open the command line interface and tell NPM to download the package you want. ... Now you have downloaded and installed your first package!
🌐
Homebrew
formulae.brew.sh › formula › node
node — Homebrew Formulae
brew install node · Also known as: node.js, node@25, nodejs, npm · Open-source, cross-platform JavaScript runtime environment · https://nodejs.org/ License: MIT · Formula JSON API: /api/formula/node.json · Formula code: node.rb on GitHub ·
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install node.js and npm on windows
How to Install Node.js and NPM on Your Windows System
August 4, 2025 - In a web browser, navigate to the Node.js Downloads page. Click the Windows Installer button to download the latest stable version with long-term support (LTS). The installer also includes the NPM package manager.
🌐
GitHub
gist.github.com › thejmazz › 72456e3f29cf0bf56d4a
Install Node and npm on Linux/OS X/Windows w/o sudo · GitHub
The simplest option is ~/node. If you want to keep your home folder clean, you can install node to /usr/local/node. Then you will have to sudo chown `whoami` /usr/local/node. If you are on a server and want to give different users the same global ...
🌐
Radixweb
radixweb.com › blog › installing-npm-and-nodejs-on-windows-and-mac
How to Install NPM and Node.js on Windows and Mac Devices?
September 17, 2025 - Learn what is NPM, how to install Node.js and NPM on Mac and Windows, Node.js installation with Homebrew and NVM and few points to consider while installing Node.js and NPM.
🌐
HashStudioz Technologies
hashstudioz.com › home › how to install node.js and npm on windows and mac?
Install Node.js and NPM Guide: Easy Steps for Windows and Mac
September 4, 2025 - In this brief tutorial, we’ll guide you through the process of installing Node.js and NPM (Node Package Manager) on both Windows & Mac operating systems. Node.js is a robust JavaScript runtime that allows the development of scalable & efficient web applications.
🌐
npm
npmjs.com › package › node
node - npm
2 weeks ago - Installs a node binary into your project, which because npm runs scripts with the local ./node_modules/.bin in the PATH ahead of the system copy means you can have a local version of node that is different than your system's, and manage node ...
      » npm install node
    
Published   Nov 26, 2025
Version   20.19.6
🌐
Ramotion
ramotion.com › blog › how-to-install-npm
A Step-by-Step Guide to Install NPM for Beginners | Ramotion Agency
July 10, 2025 - Complete fuide how to install NPM is here. Learn to install npm, the Node Package Manager, on Windows, macOS, and Linux.
🌐
DEV Community
dev.to › ms314006 › how-to-install-npm-through-nvm-node-version-manager-5gif
How to install npm through NVM(Node version manager)? - DEV Community
August 2, 2020 - The first way is node installer which I always did when I want to install npm before, because this way is easily, you just need to go to the website of node, download the node installer and install it(Whatever you choose the LTS or Current version), ...
🌐
Carmatec
carmatec.com › home › how to install node.js and npm on windows, macos, & linux
How to Install Node.js and npm on Windows, macOS, & Linux
August 23, 2024 - Visit the Node.js official website. Download the Windows Installer (.msi) for the LTS (Long Term Support) version. ... Run the downloaded .msi file. Follow the installation prompts, ensuring that you check the box to include npm in the installation.
🌐
GitHub
gist.github.com › MichaelCurrin › aa1fc56419a355972b96bce23f3bccba
Install Node.js and NPM · GitHub
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - $ sudo apt update · Install Node using APT.
🌐
Treehouse
treehouse.github.io › installation-guides › mac › node-mac.html
Installing Node.js® and NPM on Mac
You should have some familiarity with the Mac Terminal application since you’ll need to use it to install and test Node and NPM. You’ll also need the Terminal to use Node.js and NPM.
Top answer
1 of 16
269

Fresh installation

Use the NodeSource PPA. For details look at the installation instructions. First, choose the Node.js version you need and add the sources for it:

v=8   # set to 4, 5, 6, ... as needed
curl -sL https://deb.nodesource.com/setup_$v.x | sudo -E bash -

Then install the Node.js package.

sudo apt-get install -y nodejs

P.S.: curl package must be installed on server for these code lines.

Upgrading

If you have nodejs already installed and want to update, then first remove current instalation and install it again using scripts above.

sudo apt-get purge nodejs npm
2 of 16
180

Generally speaking, loading arbitrary data from a URL into a root shell session is not a good idea and I wish people would stop peddling it as a solution for everything - "Please just run this script I'm sending you, and also while we're at it - I have a bridge you'd probably be interested in purchasing".

As an alternative, here's the "Ubuntu Way" of doing the same, where you can see how the system is being updated and know what repositories and what keys are added to your system configuration:

curl https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb https://deb.nodesource.com/node_7.x $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install nodejs

And here's the "post deprecation of apt-key way" of doing the same thing:

curl https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_7.x $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/nodejs.list
sudo apt update
sudo apt install nodejs

This is for the latest (at time of writing) Nodejs version 7. Other versions can also be gotten with a simple change to the repo URL - consult nodesource.com documentation for details.

🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-20-04
How to Install Node.js on Ubuntu | DigitalOcean
May 2, 2025 - You can do this by installing the npm package with apt: ... This allows you to install modules and packages to use with Node.js.
🌐
npm
docs.npmjs.com › getting-started
Getting started | npm Docs
About npm CLI versions · Downloading and installing Node.js and npm · Troubleshooting · Generating and locating npm-debug.log files · Common errors · Try the latest stable version of node ·