The update of the NPM means the update node package manager to the latest version. The update of NPM updates the Node.js and modules to the latest version.
npm update [-g] [<pkg>...]
Here, -g refers to global and pkg refers to package.
Method 1: Using
npm update command to update the node package manager.
npm update -g
Method 2: Using
npm@latest command to update the node package manager.
npm install npm@latest -g
Method 3: Using PPA repository (only for Linux).
sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs npm
Method 4: Using cache cleaning & stable installing (only for Linux).
sudo npm cache clean -f sudo npm install -g n sudo n stable
Method 5: Using
npm@next to update the node package manager.
npm install -g npm@next
- How to update Node.js and NPM to next version ?
- Node.js | NPM (Node Package Manager)
- How to install the previous version of node.js and npm ?
- What are the differences between npm and npx ?
- Steps to Create and Publish NPM packages
- How to use External Modules and NPM in a project ?
- Difference between npm and yarn
- ReactJS | Basics of ES, Babel and npm
- How to import SASS through npm ?
- How to import LESS through npm ?
- Introduction to NPM scripts
- What is the meaning of --save for NPM install ?
- Node.js NPM arraybuffer-to-string Module
- Node.js NPM string-to-arraybuffer Module
- Node.js NPM shortid Module
- Node.js NPM uuid
- How to install modules without npm in node.js ?
- PHP | MySQL UPDATE Query
- How to directly update a field by using ng-click in AngularJS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.