Open In App
Related Articles

How to update Node.js and NPM to next version ?

Improve Article
Save Article
Like Article

Node.js is a cross-platform JavaScript environment that can be used for server-side scripting. Due to its non-blocking workflow, Node.js is popular among the web developers for building a dynamic web application. Node Package Manager also known as npm is the package manager for Node.js. It also serves as a command-line utility for interacting with the npm online repository for package installation, version management, and dependency management. It is important to have Node.js installed in order to use npm. Also, working with updated versions of Node.js and npm ensures better performance and added features.Stable version of Node.js can be downloaded or updated from the official Node.js website as well as through the command line using Node Version Manager(nvm). nvm was originally developed for Linux systems, however nvm can be installed separately for Windows system by the following steps:

  1. Go to this site:
  2. Install and unzip the file
  3. From cmd type nvm -v to ensure nvm is installed.

After installing nvm, the following can be done to update Node.js to the latest version:

nvm install <version>


Check the list of available Node.js version in the system using the following command:

nvm list 

To use the desired version, use the following command:

nvm use <version>


Update npm: To update NPM, use the following command:

npm install -g npm



Below is a demonstration for updating Node.js and npm versions for Linux systems. Install nvm in Linux:

# curl -o- | bash OR # wget -qO- | bash

Check if nvm is installed successfully

Open a new terminal
nvm -v

To install latest version of node, use the following command.

# nvm install node
# nvm install --lts
# nvm install 


Check all the available version of node on the system:

# nvm ls


Use a particular version

# nvm use 


Update npm to latest version:

# npm install -g npm 


JavaScript is best known for web page development but it is also used in a variety of non-browser environments. You can learn JavaScript from the ground up by following this JavaScript Tutorial and JavaScript Examples.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 10 Nov, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials