Updating npm when using nvm-windows

Solution 1:

This is a duplicate from my answer here: https://stackoverflow.com/a/50955293/491553

Here is how I upgrade npm when running nvm-windows:

cd %APPDATA%\nvm\v8.10.0           # or whatever version you're using
move npm npm-old
move npm.cmd npm-old.cmd
cd node_modules\
move npm npm-old
cd npm-old\bin
node npm-cli.js i -g npm@latest

And boom, upgraded.

Solution 2:

Several workarounds are available in this Issue on the nvm-windows github repo:

https://github.com/coreybutler/nvm-windows/issues/300

There are examples using DOS, PowerShell, bash, and batch scripts.