npm Getting started with npm Installation or Setup



npm is bundled with Node.js, so if you install Node.js you'll automatically have npm installed too. You can choose between a Current and a LTS version


For Microsoft Windows you can download a MSI installer from


For Apple OS X you can download a PKG installer from the same location


For Linux you can use your package manager to install Node.js and npm.

You can also compile Node.js from source and you'll still get npm. There is also a script you can run which will install npm:

curl -L | sh

Upgrade npm to the latest version

The recommended method of updating your npm installation is to simply have npm install itself:

npm install -g npm@latest

You can alternatively upgrade to the current LTS version rather than the latest version:

npm install -g npm@lts

You can also install any version of Node (and npm) with nvm. When installing globally with npm with an nvm installation, you do not need to use sudo (or Run as Administrator on Windows).