Skip to content
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

NVM doesn't know the installed lts version is outdated. #3198

Open
avin-kavish opened this issue Sep 19, 2023 · 7 comments
Open

NVM doesn't know the installed lts version is outdated. #3198

avin-kavish opened this issue Sep 19, 2023 · 7 comments
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. pull request wanted This is a great way to contribute! Help us out :-D

Comments

@avin-kavish
Copy link

avin-kavish commented Sep 19, 2023

$ nvm use --lts
Now using node v16.17.0 (npm v8.15.0)

$ nvm install --lts
Installing latest LTS version.
Downloading and installing node v18.18.0...
Downloading https://nodejs.org/dist/v18.18.0/node-v18.18.0-linux-x64.tar.xz...
############################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.18.0 (npm v9.8.1)

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.

@ljharb
Copy link
Member

ljharb commented Sep 19, 2023

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.

@ljharb ljharb added installing node Issues with installing node/io.js versions. bugs Oh no, something's broken :-( pull request wanted This is a great way to contribute! Help us out :-D labels Sep 19, 2023
@ljharb
Copy link
Member

ljharb commented Sep 20, 2023

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?

@ljharb ljharb added needs followup We need some info or action from whoever filed this issue/PR. and removed bugs Oh no, something's broken :-( labels Sep 20, 2023
@avin-kavish
Copy link
Author

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.

@ljharb
Copy link
Member

ljharb commented Sep 21, 2023

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.

@avin-kavish
Copy link
Author

Right, I think in that case just a notice would work - using "latest locally installed lts version" or similar...

@unlikelyzero
Copy link

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?

@ljharb
Copy link
Member

ljharb commented Mar 26, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. pull request wanted This is a great way to contribute! Help us out :-D
Projects
None yet
Development

No branches or pull requests

3 participants