How to upgrade / install latest version of npm on Ubuntu

npm is the package manager for the Node JavaScript platform. When we used installed npm on Ubuntu using following command

$ sudo apt install npm 

By default ubuntu unstalled npm version 3.5.2, which you can check as,

$ npm -version
3.5.2

But the software, we were trying to compile required npm version more than 3.5.2, so we upgraded npm to latest stable version using below command,

$ sudo npm install npm@latest -g 

Now you can check the version of latest npm as,

$ npm -version
6.14.5

Leave a Comment