node.js - How do I update node and npm on windows? -
i tried this:
sudo npm cache clean -f sudo npm install -g n sudo n stable
...but didn't work.
so, how do on windows?
this new best way upgrade npm on windows.
run powershell administrator
set-executionpolicy unrestricted -scope currentuser -force npm install -g npm-windows-upgrade npm-windows-upgrade
note: not run npm -g npm
. instead use npm-windows-upgrade
update npm going forward. if run nodejs installer, replace node version.
- upgrades npm in-place, node installed it.
- easy updating, update latest running
npm-windows-upgrade -p -v latest
. - does not modify default path.
- does not change default global package location.
- allows easy upgrades , downgrades.
- officially recommended npm team.
- a list of versions matched between npm , node (https://nodejs.org/en/download/releases/) - need download node installer , run update node (https://nodejs.org/en/)
Comments
Post a Comment