-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
nvm current returns system instead of version number, suspect nvm use not working #2686
Comments
nvm is explicitly unsupported when installed via homebrew; what happens if you try installing nvm with the install script? In this case, it's probably that your homebrew-managed PATH isn't correctly allowing nvm's path to take precedence over |
OHMY, what an embarrassment, I cannot read. Yes, uninstalling brew nvm and running the official install from curl did the trick. Please accept my apologies, and thank you. |
Sorry, there must be somethign else. I unsinstalled the brew version, installed nvm through curl. I still cannot change versions, current appears to be "system"
Again my config:
I honestly dont know where more to look at. Yes, I restarted terminal, and even the computer. |
I am suspecting nvm (or some node versions installed through it) will not work in M1 macs. And I am not willing to use Rosetta. A solution I found is bypassing nvm altogether, and install a specific version of node through brew, but then I am obviously missing the whole point of nvm (no versions are possible, other that installing/uninstalling node every time I change project). |
nvm works fine on M1 macs; but node itself doesn’t support m1 on less than v16 except with Rosetta. |
It’s possibly 16.0.0 doesn’t support it; but 16 latest certainly does. There’s a whole section in nvm’s readme about it. |
Yeah, but same happens for v16.13.1, I still get the |
In that case it’s likely a PATH issue. Make sure sourcing nvm is the last thing in your profile file; or at least, that it happens after the last thing that prepends to the path. |
hold on, my problem is only inside tmux session! if I try nvm on a regular kitty tab it just works. inside tmux it does not... will investigate. |
the super weird thing about it is that inside AND outside tmux,
|
What’s the PATH diff between inside and outside? |
OUTSIDE TMUX:
INSIDE TMUX:
Going to look at those PATH changes as well. Thanks for all the help. |
That strongly implies that whatever profile file tmux sources (that your regular shell doesn't) is doing more PATH stuff with homebrew's node after nvm is sourced. (node shouldn't ever be installed with homebrew regardless, but it shouldn't interfere with nvm at all) |
Yes, it's currently a mess. Most likely still artifacts from previous brew installs, since I was convinced brew was a viable option. I will try to remove all traces of nvm, npm, node, ... and reinstall nvm from curl/git again, to see if that helps. Thank you again. |
I'll close this for now, but will immediately reopen it if there's something actionable for nvm. Happy to continue discussing regardless. |
I can confirm this is now working in/outside of tmux. I did:
thank you again |
OK, sorry to reopen this issue. I had this all solved, but after installing another brew formula (that has node as a dependency), I am back to original problem. Inside tmux, node version is the one of the node dependency installed by that formula, no matter if I previously had installed nvm using git. Not sure how to avoid this (besides uninstalling every formula that might have node as a dependency, which is bummer) thank you |
OK, found this solution, but implies having to manually add each of node versions installed via nvm to the PATH, which is also a bummer. |
Yeah that sucks a lot. I think a better solution is rearranging your profile file so that homebrew’s path ends up after nvm’s - iow, make sure nvm’s lines are last |
This comment was marked as outdated.
This comment was marked as outdated.
Your PATH in |
I fixed the loop, I don't need to export each path, just prepend it.
No, really, my brew file is sourced before my nvm file, and brew's node version. Don't ask me why. The only solution for me was to force the loop above. |
The reason why brew wins, is the way it creates the EXPORTs and PATH (the recommended way of doing so):
|
does that eval happen before or after the nvm lines? |
before |
ok, then i don't understand why nvm isn't able to force its stuff to go in the front of the PATH. Do you have a default set? |
yeah, same here :)
Yes, 16. But it doesn't matter, brew version (17) wins. To be clear, it is working now, but it's a bit annoying to trace and discover. Just posted here so it can be tracked, for other people. Thank you again. |
Try using:
Then try to install and run the nvm version you want. This will change the processor architecture to emulate old Intel chips. |
problem description
nvm current returns
system
instead of version number (i.e.v16.13.1
). I need the version number not an alias, I suspectnvm use vX.Y.Z
is not working.Operating system and version:
macOS 12.1 21C52 arm64
nvm debug
output:nvm ls
output:How did you install
nvm
?Homebrew
What steps did you perform?
brew install nvm
What happened?
Worked
Is there anything in any of your profile files that modifies the
PATH
?Yes, PATH is listed in the debug output above
The text was updated successfully, but these errors were encountered: