Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update npm itself?

I am trying to update npm itself:

npm uninstall npm -g 

Responds with:

unbuild [email protected] 

But when I go:

npm --version 

I get 1.4.28? How to upgrade the npm itself?

like image 703
Leeuwtje Avatar asked Jul 08 '15 10:07

Leeuwtje


People also ask

Can I upgrade npm without upgrading Node?

To upgrade nvm-windows, run the new installer. It will safely overwrite the files it needs to update without touching your node.


2 Answers

By using this command you can update npm to the latest release by using npm itself :

 npm i -g npm@latest 
like image 114
Slim Coder Avatar answered Sep 28 '22 23:09

Slim Coder


You can try this:

cd /usr/lib/node_modules

npm install npm@latest

Edit:

npm install -g npm worked for me.

enter image description here

like image 38
Pratyush Khare Avatar answered Sep 28 '22 22:09

Pratyush Khare