N: Not able to switch to different version

Created on 5 May 2020  路  3Comments  路  Source: tj/n

Summary

I have two node version installed. One is 8.15.1 and other is 10.15.0. Currently, the active version is 8.15.1 and now I want to switch to 10.15.0. So when I tried changing it, the node version stays the same.

Steps to Reproduce

  1. type the command "n"
  2. select the version you wish to set as active
  3. check node version

Expected Behaviour

Should change the node version

Actual Behaviour

Not changing node version

Other Information

Kapture 2020-05-05 at 22 36 23

Configuration Details

$ n --version
6.5.1

$ command -v node
/usr/local/bin/node

$ node -p process.platform
darwin

Most helpful comment

You have got node installed in more than one location, and a version not being managed by n is earlier in the PATH. Your video shows this with path to the freshly "installed" version being different than the "active" version. (The 8.15.1 you see in the n menu is a different copy on disk from the 8.15.1 which is "active", so extra confusing!)

You can confirm the multiple locations (on Mac) and see all the copies in your PATH with:

which -a node

Running n doctor should also detect this setup problem and warn you.

The main two fixes are, either:
1) change your PATH in your shell startup file to put your local bin location before /usr/local/bin. (You said in a deleted message you had done this and it looked like you were on the right track.)
2) or, if you are the only user on the computer, you could delete the copy of node in /usr/local/bin/node and probably the copy of npm from there too

All 3 comments

Mistakenly closed the issue 馃槄Can you please help me out here?

You have got node installed in more than one location, and a version not being managed by n is earlier in the PATH. Your video shows this with path to the freshly "installed" version being different than the "active" version. (The 8.15.1 you see in the n menu is a different copy on disk from the 8.15.1 which is "active", so extra confusing!)

You can confirm the multiple locations (on Mac) and see all the copies in your PATH with:

which -a node

Running n doctor should also detect this setup problem and warn you.

The main two fixes are, either:
1) change your PATH in your shell startup file to put your local bin location before /usr/local/bin. (You said in a deleted message you had done this and it looked like you were on the right track.)
2) or, if you are the only user on the computer, you could delete the copy of node in /usr/local/bin/node and probably the copy of npm from there too

An answer was provided, and no further activity in a month. Closing this as resolved.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Was this page helpful?
0 / 5 - 0 ratings