Node.js: It 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 that makes 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: NPM(Node Package Manager) installs and manages version and dependency of packages for Node.js. NPM is installed with Node. The aim of NPM is automated dependency and package management, anytime or anyone needs to get started with the project they can simply rum NPM install and all the dependencies they will have immediately. It is possible to specify which version your project depends upon to save your project from breaking due to updates.
Installing the previous version of Node.js and NPM: To install the previous versions from the latest version, the latest version of Node.js should be installed on your computer or you can install it from the official site of Node.js.
Step 1: Check the installed version of Node and NPM on the computer use the following command respectively
- In windows:
node -v

npm -v

- In linux:
node --version
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
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 :
20 Mar, 2020
Like Article
Save Article