Open avin-kavish opened 1 year ago
It's actually a very good thing it doesn't, because nvm use
shouldn't ever make a network call.
I agree that trying to install --lts
when the local machine resolves that to 16.17, and getting "not that", is a bug. However, the local machine not updating its local LTS mapping until a network call is made is quite intentional.
hmm, thinking about this more. if you wanted to stay on the LTS line, you'd have done nvm install --lts=gallium
. by asking for --lts
, you're explicitly asking for the latest possible LTS thing.
I could certainly add some warning output when the version you may have expected to get has, due to server updates, changed - would that help?
yeah, I think.
Also this might be a bit more advanced, don't know if it's possible - it could check the LTS expiry date from a local lookup table. I think these dates are set in advance so it could cache a table from the last network call.
I’m intentionally not going to make anything time-based in nvm; those dates change, and system clocks aren’t always correct, and EOL status doesn’t change what version of node you need.
Right, I think in that case just a notice would work - using "latest locally installed lts version" or similar...
For my usecase, I'd like to be able to ensure that my build is always installing the latest version from the lts/iron
line. Should I run nvm clear cache
before doing a nvm install lts/iron
?
@unlikelyzero no need; the install command will always get the latest version. The cache doesn’t prevent version listing, it only stores binaries and source.
I typed
nvm use
while node 16 was installed as the lts version. It used 16 without actually checking whether it was the current LTS version. Would be good if it did the check.