Open In App
Related Articles

How to install the previous version of Node and npm ?

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

In this article, we will learn how to install the previous versions of the nodejs and npm using terminal commands.

Node JS:

Node is a JavaScript runtime(server-side) built on V8 JavaScript engine of Google Chrome. It was developed in 2009 by Ryan Dhal. Node.js uses an event-driven, non-blocking input/output model, making it lightweight and efficient. It is perfect for data-intensive real-time applications. Node is like a wrapper around the V8 with built-in modules providing many features that are easy to use in asynchronous APIs.

NPM (Node Package Manager):

NPM (Node Package Manager) is bundled with Node.js and automates package and dependency management for Node.js projects. By running “npm install,” users can instantly fetch and install project dependencies. It enables version control to prevent project disruptions and ensures seamless onboarding for new contributors.

Installing the previous version of Node JS and NPM:

Step 1: Check the installed version of Node and NPM on the computer use the following command respectively

  • In windows:
node -v and npm -v
  • In linux:
node --version and npm --version


Step 2: For installing the previous version of Node use the following command:

  • In windows:
npm install -g node@version

Example:

npm install -g node@10.9.0
  • In linux:
sudo  apt-get install nodejs=version-1chl1~precise1

Example:

sudo  apt-get install nodejs=10.9.0-1chl1~precise1

Step 3: To install previous version of NPM use the following command:

  • In windows:
npm install -g npm@version 

Example:

npm install -g npm@4.0.0
  • In linux:
sudo  apt-get install npm=version-1chl1~precise1

Example:

sudo  apt-get install npm=4.0.0-1chl1~precise1

Last Updated : 25 Dec, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads