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

Unable to switch versions of Node. #290

Closed
hzhu opened this issue Jul 6, 2015 · 9 comments
Closed

Unable to switch versions of Node. #290

hzhu opened this issue Jul 6, 2015 · 9 comments

Comments

@hzhu
Copy link

hzhu commented Jul 6, 2015

I'm trying to switch Node versions on my system like the gify demo: https://github.com/tj/n#user-content-n
But when I hit enter on a selected version, and type node --version the version didn't change. Can anyone help?...

node3

@maxrimue
Copy link
Contributor

maxrimue commented Jul 6, 2015

My guess is that the account you use doesn't have write permissions for /usr/local/n, what happens if you instead use sudo n and then change the version?

@Hesesses
Copy link

Hesesses commented Jul 7, 2015

+1

@hzhu
Copy link
Author

hzhu commented Jul 13, 2015

hi @maxrimue , I still get the same problem. The version doesn't change.
node99999

@maxrimue
Copy link
Contributor

Have you changed the N_PREFIX so n downloads Node.js somewhere else than
/usr/bin/? Or have you installed Node.js with another package manager like
homebrew?
Henry Zhu [email protected] schrieb am Di., 14. Juli 2015 um 00:51:

hi @maxrimue https://github.com/maxrimue , I still get the same
problem. The version doesn't change.
[image: node44]
https://cloud.githubusercontent.com/assets/1811365/8662660/f142e2bc-2976-11e5-853f-088b51824db8.gif


Reply to this email directly or view it on GitHub
#290 (comment).

@troy0820
Copy link
Collaborator

If you used nvm, they go into ~/.nvm folder and this may be the reason your switch isn't working as well.

@hzhu
Copy link
Author

hzhu commented Jul 16, 2015

I apparently used Boxen a long time ago, so which node tells me /opt/boxen/nodenv/shims/node.

I tired export N_PREFIX=/opt/boxen/nodenv/ but that still didn't work. Any ideas how to make fix this issue?

@maxrimue
Copy link
Contributor

You'll have to remove Boxen, or at least the Node.js it installed. I'm not sure how you would remove just Node.js from Boxen, but I found that this is how you remove Boxen itself:

Run script/nuke from inside the /opt/boxen/repo directory.
(boxen/boxen#86)

@hzhu
Copy link
Author

hzhu commented Jul 18, 2015

Thank you @maxrimue! Removing Boxen did the trick.

@hzhu hzhu closed this as completed Jul 18, 2015
@wpcarro
Copy link

wpcarro commented Apr 24, 2018

Thanks @maxrimue about using sudo. I feel like it would be a much better UX if n warned about permissions issues instead of silently failing to switch versions.

My issue was a permissions issues. The problem is, I'm unsure how it ended up this way anyways. I installed n using:

curl -sL https://git.io/n-install | bash -s -- -q

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

5 participants