Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to switch to different version #620

Closed
soysandeep opened this issue May 5, 2020 · 3 comments
Closed

Not able to switch to different version #620

soysandeep opened this issue May 5, 2020 · 3 comments

Comments

@soysandeep
Copy link

soysandeep commented May 5, 2020

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
@soysandeep soysandeep reopened this May 5, 2020
@soysandeep
Copy link
Author

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

@shadowspawn
Copy link
Collaborator

shadowspawn commented May 6, 2020

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

@shadowspawn
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants