Tarun Wadhwa
Tarun Wadhwa

Reputation: 11

Unable to downgrade Node to specific version

I am building a sample application in which I need to use Node Version v9.11.2 and npm 4.0.0. Currently I have Node Version v16.4.0 installed on my system. I tried to install the specific version by uninstalling the latest version and installing version 9.11.2 from official website Problem: The problem is I can uninstall the latest version without any problem but when I try to install older version(9.11.2) the command gets opened and it does nothing. I also tried to install the older version using cli commands ie. npm install -g [email protected], it installs the version but on checking the version using node -v, it still shows the latest version(16.4.0)

Below are the screenshots for better understanding

Installed version 9.11.2 but showing 16.4.0

Any Solution please ?

Upvotes: 0

Views: 685

Answers (2)

A good option is to use NVM: https://github.com/coreybutler/nvm-windows (Windows) or https://github.com/nvm-sh/nvm (unix, macOS). With NVM you can enable different versions of node on the same machine and switch from one to another, usually it takes care of managing the installed packages and adding them to its own management system.

Upvotes: 1

Daniel
Daniel

Reputation: 239

Is using docker a possibility? If so you can simply get a docker image of the required version and use if from there.

Another way is to use NVM which is a really useful tool to manage nodejs versions. I'm including their github repo for your convenience:

https://github.com/nvm-sh/nvm

Upvotes: 1

Related Questions