-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
Feedback when activating node version #198
Comments
When have you seen no error output when the version switch didn't complete successfully? |
Sorry, I was unclear. This isn't when there's an error, this is to differentiate the two success cases:
Here is the output currently:
Note that there is no way to differentiate what happened in the first I'd like to change the first
|
@tjwebb - If you installed npm via sudo, then anything installed globally requires sudo. If I call n without sudo and change the active version, it doesn't successfully change and there's no feedback. It was really confusing for me before I realized my mistake. +1 for feedback after selection |
I have been confused by lack of output too, especially when intending to restore the version of npm included with a version of node (and nothing happened because that node was already installed). Changing the activate routine to always produce output and using same format as during download could look like this. $ n 8.11.3
install : node-v8.11.3
mkdir : /usr/local/n/versions/node/8.11.3
fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-darwin-x64.tar.gz
######################################################################## 100.0%
activated : v8.11.3
$ n 8.11.3
unchanged : v8.11.3
$ n 6.14.3
activated : v6.14.3
$ n [and pick 8.11.3 from list]
activated : v8.11.3 |
This issue has not had any activity in over six months. I have opened a newer issue #543 with more detail as this was a behaviour I found confusing too. Subscribe to that issue for updates and/or give it a 👍 Feel free to open a new issue if it comes up again, with new information and renewed interest. Thank you for your contributions. |
Currently there's no feedback to differentiate whether a different node version was activated or not. Nothing is printed to stdout and the return code is 0/success whether the node version changed or not.
At a minimum I'd like something like:
printed out if a version other than v0.10.32 was active before the command was run.
This would allow other programs (namely Ansible in my use case) to know if a change was affected to the system since it can't rely on the return code.
We could also add a message along the lines of "v0.10.32 already active" if v0.10.32 was already active before the command was run, though I personally don't think this is necessary.
If there's interest in this, I can submit a PR.
The text was updated successfully, but these errors were encountered: