-
-
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
[Fix] install
: Ignore npm command under $NVM_DIR when checking for global modules
#2348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This will need a regression test.
Re regression tests — I may have to leave that to someone better at
I think 2a and 2b are probably still the correct behavior in terms of #2339? We can assume in that case the user already has some idea what nvm is and the difference between system and nvm-managed Node. But I can see an argument the other way as well — people may still want to know that those modules are hanging around, esp. if their binaries might end up ahead of nvm-installed binaries in the path. It's probably more trouble than it's worth to exhaustively search Note: I wasn't sure about 2b, till I realized the second time I thought I was trying 2b I was actually trying 3. |
Looks like the relevant unit test is failing in CI. I'll take a look at that. |
Having trouble replicating the failure locally — I'll see if I can get it failing in a container. |
OK, still not sure why I couldn't get it to fail on my Mac — something different about my shell setup vs. the Travis environment, such that inside the test I've tweaked the test a little so most of the cases are with I suppose the alternative would be to have Travis install |
I think that would indeed be overkill :-) a mock should be sufficient. |
OK! Have a look at the test and see what you think. |
It's not an especially clever check — just a substring match — but should cover a typical situation.
Fixes #2339.