How to downgrade node version?

Viewed 17382

I want to downgrade my version using npm. The current version is 16.13.1. I want to downgrade this to 12.0.1. Can anyone tell me how to do it?

Thanks!

7 Answers

You can accomplish that with Node Version Manager. Install nvm first, and in a terminal:

nvm install 12.0.1

Then

nvm use 12.0.1

You could also install the node npm module to change (upgrade or downgrade) the NodeJS version for the specific project.

You can use: npm install -g node@version.

So for example in your case it would be -> sudo npm install -g node@12.0.1

might have to force it with --force at the end.

Try the n package from npm. Find it here.

npm install -g n

n 10.16.0
n lts

Simply execute n <version> to download and install a version of Node.js. If has already been downloaded, n will install from its cache.

first check your node version

node -v
sudo npm install -g n
sudo n stable
sudo n 14.6.0 (you can chnage version here as you want to move)
npm install (jst run after all)

now you can check the node and npm version by

 node -v
 npm -v

I finally found a simple solution.

  1. Uninstall the current Version
  2. Download the version you want.

It works fine for me.

Thanks!

Related