Home > Back-end >  How to downgrade Node version with n
How to downgrade Node version with n

Time:09-17

I installed the latest node version 18.9.0 with brew. The I installed n with npm n. I can't switch the active version from 18.9.0 to 17.4.0 using n. I am not keen on using nvm, is there a way to do it with n?

I installed the latest version (18.9.0) first and then installed n globally and then now am trying to change the version with n, but I cannot seem to change the active version to a the lower one installed with n.

After installing n globally, I sudo n 17.4.0 but it does not change the active version.

enter image description here

CodePudding user response:

well, to install n, you should install it globally with:

$ npm install -g n

and then you just have to run

$ n 17.4.0

CodePudding user response:

I recommend using fnm works really good

CodePudding user response:

Since you have said using

$ n 17.4.0

is not working for you, maybe you could try using

$ n

And then pick the version you want using the arrow keys? That seems to work for me.

CodePudding user response:

first - install it globally :

$ npm install -g n

then - run this code:

$ n 17.4.0

CodePudding user response:

The trace statements are showing that you have two copies of node installed. The one installed by n (to /usr/local/bin/node) is later in your PATH. The "active" version was installed by homebrew.

You could uninstall the homebrew version, or modify your PATH.

(If you run n doctor this problem will be detected and explained.)

  • Related