The new best way to upgrade NPM on Windows:
Run PowerShell as Administrator
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade
Note: Do not run
npm i -g npm. Instead use
npm-windows-upgrade to update npm going forward. Also if you run the NodeJS installer, it will replace the node version.
- Upgrades npm in-place, where node installed it.
- Easy updating, update the to the latest by running
npm-windows-upgrade -p -v latest.
- Does not modify the default path.
- Does not change the default global package location.
- Allows easy upgrades and downgrades.
- Officially recommended by the NPM team.