Update NodeJs:

Clear the NPM cache:
sudo npm cache clean -f


Install helper with 'n'
sudo npm install -g n


Install most latest and stable version of Node.js
sudo n stable

if you have a specific version, you can do the following

sudo npm install -g n 16.08

NPM Upgrade:

  1. Open PowerShell or Command Prompt as administrator
  2. Enter Command: npm -v
  3. Note your current npm version
  4. Enter Command: npm -g update npm
  5. Enter Command: npm -v
  6. Note your current npm version
  7. Done

Its that easy!

I recently had to update my old version of npm because I was going to start a quiz project and I need to download the greatest and latest version on npm and ionic. Anyway, I hope that helps.

You may also get a message like this:

   │                                                                │
   │     New major version of npm available! 6.14.11 -> 7.14.0      │
   │   Changelog: https://github.com/npm/cli/releases/tag/v7.14.0   │
   │               Run npm install -g npm to update!

 

 

Good luck.