-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Show the version for "system" in nvm ls
#1287
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
base: master
Are you sure you want to change the base?
Conversation
wow ... the build failed error message is soooo long lol ... |
The reason I never displayed the system version before is because I didn't want anyone to do |
@ljharb do you mean to prevent confusion about the version managed by nvm and system? I thought this display is very useful so that I don't need to do |
Yes, to prevent that confusion, exactly. What's the use case for checking the system version more than once in a while? |
(also, |
As I have more than one development environments, which may including FreeBSD, Ubuntu 14.04, Ubuntu 16.04, Debian 7, Debian 8, etc, they all have their own but different nodejs versions, and when I want to use a certain version of nodejs, I will use About the confusion, maybe use |
The arrow isn't the thing I'm worried about, it's the version number. Even if a certain version is installed on the system, you generally would want to install it again so that |
Not sure if this my personal scenario only, but sometimes I just want to test if a certain version could work with the certain project, I don't really need it to be managed by |
I'm fine with adding helpful output next to "system" - but anything that looks like a version number seems like it could dangerously cause confusion. |
hmmmm ... then need to think about the how to display since what I want is the version number which is you don't want, haha. |
Whatever you come up with, citing examples of other version managers (like rvm, rbenv, virtualenv, etc) and if/how they display the system version would help. |
I have not test rvm or the other version managers yet, but come up with |
@PeterDaveHello would you mind rebasing this? |
Looks like it needs a rewrite, will take some time, a simple rebase doesn't look so good to resolve the conflict. |
that's what i was worried about; the changes to use awk in a bunch of places may have complicated this. it'd be great to update the PR with a rewritten approach, though :-) |
c6cfc3a
to
c20db2a
Compare
093fc36
to
444f885
Compare
Augment `nvm ls` to include the actual system Node.js version by printing it as `system (-> vX.Y.Z)`. Update `nvm_print_versions` to render the system line consistently with existing color semantics without altering other lines. This clarifies what “system” resolves to in practice, reduces ambiguity when comparing installed versions, and aligns with the intent of historical work in this area. The implementation uses a subshell to run `nvm deactivate && node -v` to avoid mutating the current shell environment, and confines changes to the minimal formatting and list-assembly logic.
444f885
to
cefd4b0
Compare
@ljharb, with some help from GPT-5, the PR has been updated. |
Show the actual version from "system" for
nvm ls
before:
after: