How to downgrade Node version with n

Viewed 38

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

5 Answers

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.

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.)

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

I recommend using fnm works really good

first - install it globally :

$ npm install -g n

then - run this code:

$ n 17.4.0
Related