Steps to Install the previous version of NodeJS and NPM
Follow these steps to install a specific Node.js version in windows as well as linux:
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
How to install the previous version of Node and npm?
Installing a specific version of Node.js and npm can be essential for compatibility reasons or to work with legacy projects. In this guide, we’ll go through the steps to install an older version of Node.js and npm on your system.