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

Is there a way to use >=18.16.0 in .nvmrc file? #3167

Open
OnkarRuikar opened this issue Aug 19, 2023 · 7 comments
Open

Is there a way to use >=18.16.0 in .nvmrc file? #3167

OnkarRuikar opened this issue Aug 19, 2023 · 7 comments

Comments

@OnkarRuikar
Copy link

We want to enforce >=18.16.0 because our code is facing issues with prior versions. The string >=18.16.0 doesn't work in .nvmrc file. Nvm throws >=18.16.0 version not found error.

Closest solution is to use lts/hydrogen. At the moment it installs v18.17.1. But this forces/nags users with v18.16.0 to upgrade. How can we handle the situation in .nvmrc file? Is there a way to configure >=18.16.0 condition?

@ljharb
Copy link
Member

ljharb commented Aug 19, 2023

no, we don’t support that - everything in nvm resolves to one single version.

generally I’d expect everyone in an org to be on the exact same version - not just in a range. Why wouldn’t you want everyone on the latest 18?

@OnkarRuikar
Copy link
Author

@ljharb thanks for the clarification!

Why wouldn’t you want everyone on the latest 18?

Because it's an open source project and all contributors are not on same node versions.

@Josh-Cena

This comment was marked as off-topic.

@ljharb

This comment was marked as off-topic.

@ljharb
Copy link
Member

ljharb commented Aug 20, 2023

@OnkarRuikar sure but in that case you’d want your contributors to have every supported version installed anyways, which includes 18.17.

@Josh-Cena
Copy link

@ljharb Thanks for the pointer; I was trying to make this not an XY problem. For the context I was the one that first complained that >=18.16.0 does not work. For me, I personally don't care if I need to install a new version every time, but I don't want versions to pile up, and nvm migrate and >=18.16.0 will both fix this for me.

@ljharb
Copy link
Member

ljharb commented Aug 20, 2023

The discussion in #1091 explains why the primary use case of nvm is in fact to have versions "pile up", so you can easily switch between multiple versions, and it's just not optimized for using it as a moving target of a single node version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@ljharb @Josh-Cena @OnkarRuikar and others