N: Unable to switch versions of Node.

Created on 6 Jul 2015  Â·  9Comments  Â·  Source: tj/n

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

Most helpful comment

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?

All 9 comments

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?

+1

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

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
https://github.com/tj/n/issues/290#issuecomment-121083541.

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

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?

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)

Thank you @maxrimue! Removing Boxen did the trick.

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
Was this page helpful?
0 / 5 - 0 ratings