Home > database >  How to install a new version of npm?
How to install a new version of npm?

Time:03-25

I know this is a noob question but I just start learning to code. I don't know why I cannot upgrade the current version of npm in my computer (5.5.1) to the newer one (8.1.2). Can someone please help me with this?

enter image description here

enter image description here

CodePudding user response:

There are couple of solutions I can think of:

Solution #1

Uninstall Node.js from your computer and install again. As the error message says, "use the version of npm that is bundled with Node.js". This is the preferred solution and very straightforward. Unless... you want to keep multiple versions of node in your computer, if that is the case, solution #2 will help.

Solution #2

Install a Node version manager (such as n). The package n allows you to download multiple versions of Node.js in your computer and switch between then when needed.


If the issue persists, you may have conflicting versions or directories in your computer. Please read this post about How to completely remove node.js from Windows. Then try re-installing from the website once you are done removing Node.

  • Related