I am using npm v5.3.0. Now I want to update npm to v5.4.1.To do this I type the following in my terminal:
npm install -g npm
without any errors.Howe
The problem was that I has set the PATH variable in my ~/.profile wrong. To help you understand.I had changed npm prefix to ~/.npm-global
~/.profile
~/.npm-global
However I set path to ~/npm-global.So I fixed the PATH variable in my ~/.profile to point to ~/.npm-global instead.
~/npm-global