How can I update npm itself?

node.jsWindowsNpm

node.js Problem Overview


I am trying to update npm itself:

npm uninstall npm -g

Responds with:

unbuild npm@2.12.1

But when I go:

npm --version

I get 1.4.28? How to upgrade the npm itself?

node.js Solutions


Solution 1 - node.js

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

 npm i -g npm@latest

Solution 2 - node.js

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

Solution 3 - node.js

See which version you have

npm -v

Install the newest npm update

npm install -g npm@latest

Upgrade to the most recent release

npm install -g npm@next 

Upgrading on Windows Microsoft wrote a small command-line tool to automate the steps below. You can go and download it here

https://docs.npmjs.com/try-the-latest-stable-version-of-npm

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLeeuwtjeView Question on Stackoverflow
Solution 1 - node.jsSlim CoderView Answer on Stackoverflow
Solution 2 - node.jsPratyush KhareView Answer on Stackoverflow
Solution 3 - node.jsHamid ShojaView Answer on Stackoverflow