Make sure to use sudo npm install -g npm if on a Mac. You can also update all outdated local packages by doing npm update without any arguments, or global packages by doing npm update -g . To update Node.
How do I make npm available globally?
- Configure npm. Run: npm config set prefix ‘~/.local/’ This modifies ~/.npmrc to include this line: prefix=~/.local/
- Make sure ~/. local/bin exists and is in your PATH. mkdir -p ~/. …
- Install packages globally. npm install -g packagename.
How do I update npm on Windows?
Easy updating, update to the latest by running npm-windows-upgrade -p -v latest .