npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

How to update npm?

Hello
I’m working on Ubuntu 18.04 and when installing “npm” I had to do it with a package gesture, NVM because when I installed it with “SUDO” I had problems with permissions.
I did the installation following instructions instructions that I had saved but now I have lost them.
Now I have the need to update NPM:
New minor version of npm available! 6.4.1 → 6.10.0 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.10.0
What is the correct way to update “npm” without having permission problems in the future?
Thank you and excuse this simple question


The likely answer is:

npm install -g npm@latest

i.e. without using sudo

nvm is managing node and npm out of your home folder, and hence hopefully no permission problems.


Thanks for support.
Ask why I did not want to make mistakes
Thank you