-
Notifications
You must be signed in to change notification settings - Fork 54
When switching directories, first compare current and target Node version before proceeding, and abort AVN activation if they are the same #78
Comments
Came here to support this issue because I just noticed this happening on my machine. It's a bit pointless to try to activate a version that it's currently in use. In my particular machine takes a few seconds to switch, which is cumbersome when the versions are the same and there's not need for switching. |
I'm confused about it too. Version switching takes quite a few seconds on my computer. |
I thought I commented on this before, but the version matching doesn't necessarily mean that the path (and hence the global modules, compilation flags, etc) are the best match. For consistency, it should perform a full check each time. Speeding up the execution of the command is welcome, but also consider how fast the underlying tool is ( |
Sorry, I don't get it what bad would happen when aborting the version switching, if the current Node version exactly matches the |
You could have the exact same version installed with both |
Uhm...I didn't think about such a situation of using both |
Thanks for the great free software.
My project uses multiple different repositories, and each has their own individual directory locally. When I change to one directory, avn sets up the version of node per the
.node-version
file in the target directory. This is desirable.However, when I change to another directory which contains another
.node-version
file having exactly the same contents, avn once again goes through the setup process.I suggest that when changing directories and switching node versions, avn should, before proceeding with anything else, compare the current and target versions of Node, and if they are the same, then abort the setup process rather than forcing the user to wait a few seconds.
Here is some sample output:
As you can see, Node 8.6.0 was unnecessarily activated multiple times.
Details
0.2.3
8.6.0
0.33.8
zsh 5.3 (x86_64-apple-darwin17.0)
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
The output of
__avn_debug
in the directory with a.node-version
file is:avn
is loaded in my~/.{bash|zsh}{_profile|rc}
file with:nvm specific
nvm
user I am confirming that I did not install with HomebrewThe text was updated successfully, but these errors were encountered: