-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Disclaimer: This is more of a feature request, however due to the nature of nvm being heavily associated with it's linux implementation, I think it is more appropriate to call it a bug when differences like this exist on what should be (and many reference guides assume to be) a 1:1 platform port.
Issue:
According to the nvm documentation for Linux, standard behavior of nvm use without arguments is to use the version specified in the .nvmrc file of the current directory, or earliest parent directory. It seems the behavior is different on windows. Unfortunately all online guides I could find are written for the linux version, and treat the two OS implementations the same. Hence, my initial confusion, and creation of this issue upon finding this repo.
How To Reproduce:
- Create
.nvmrcfile with contents6.16.0 - Open command prompt in the directory and run
nvm use - Output says "Invalid version."
- Run
nvm use 6.10.0 - Output says "Now using node v6.16.0 (64-bit)"
Expected Behavior:
nvm use with no arguments would use the version in the nearest .nvmrc file
Desktop:
- OS: Windows 10
Additional context:
I went a little crazy before realizing the doc I was referencing was for the unix versions, and I use the windows version which has a bit different behavior. I wish it wasn't so that online guides seem to neglect making it clear when offering the windows alternative that it's a completely different thing with different behaviors. Every online guide I found about using multiple node versions uses the nvm use command and never mentions that such use is unsupported by the windows versions. Unfortunately they assume the two are identical in every way, only offering small "download for Windows" links, and never indicate that differences exist.
I found the issue #318 and it seems that running the command this way now defaults to always returning Invalid version. Also it seems you stated that this usage isn't supported in #16, which is quite a long issue and wasn't necessarily about this usage except after some long discussion. Besides that relatively buried comment, there's nothing I could find specifically detailing this difference between the two, or specifically saying that this usage will never be supported. I don't really want to be using a batch script just to simulate this usage of the command when those scripts are so short they may as well just be added to the command.
tl;dr: You never explained why this usage is unsupported, so I'm taking it as a "not yet supported." I was hoping the windows implementation of nvm could be unified with the unix version here, or perhaps some better indication in the documentation here that the unix usage of the command isn't supported and an argument is always required. Maybe some section of "Differences from linux?"