Installing/upgrading npm


(Kat Marchán) #1

How do I install npm itself, or upgrade from an existing install?


On clean node v10.5.0, v10.6.0 and v10.7.0 install, npm install yelds asyncWrite is not a function and pna.nextTick is not a function
(Kat Marchán) #2
  • The preferred way of installing a fresh version of npm is to use the node.js installer itself.

  • The preferred way of upgrading npm is to use npm i -g npm@latest.

  • [Windows] Upgrading npm on Windows can fail due to issues with the node.js installer. You can use npm-windows-upgrade to try to bypass these issues.

  • [Linux/OSX] You can install or upgrade npm manually using curl http://npmjs.org/install.sh | sh.

The npm CLI team does not officially support installation through OS package managers like apt-get or Homebrew. You’re kind of on your own if you use one of those or some other method for installing or upgrading npm itself.


Resolve issue of needing third party tool to properly upgrade npm on Windows
npm Troubleshooting Guide link in Readme leads to 404
EINVAL: invalid argument, read