You could run npm i -g npm to update your node, but you should go for:
- Open a Powershell as Administrator
- Set the Execution Policy the right way, with unrestricted rights:
1Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
- Install the npm-windows-upgrade package as global:
1npm install -g npm-windows-upgrade
- Finally, run the updater and choose your desired version:
According to stack overflow user „Robert“, here are the reasons for updating NPM the way described here:
- Upgrades npm in-place, where node installed it.
- Easy updating, update the to the latest by running
1npm-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.