Skip to content

Suggestion: Create major version number alias same as codename alias! #327

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

Closed
akkadaya opened this issue Jan 14, 2023 · 5 comments
Closed

Comments

@akkadaya
Copy link

React-Native has .node-version with value 16 by default and asdf doesn't recognise that version.

asdf should be able to install version 16 same as lts-gallium version which is a symlink to the latest 16 version.

as a workaround I use:

ln -s ${HOME}/.asdf/installs/nodejs/lts-gallium ${HOME}/.asdf/installs/nodejs/16
@chriszs
Copy link

chriszs commented Jan 17, 2023

There are a number of projects where the lack of this alias is a persistent compatibility issue for me. Glad to see a workaround, though.

@bradydoll
Copy link

Looks like it doesn't support version numbers like 16.2, either.
https://github.com/shadowspawn/node-version-usage#compatibility-testing

@Albert-IV
Copy link

To add onto this, it would also be nice to have an alias like lts-14 lts-16 or lts-18. I guess if there was a major version number alias it would be less helpful, but that is what my first guess is when I'm trying to swap to an older LTS version without the codename's on hand.

@ubmit
Copy link

ubmit commented Apr 18, 2023

@akkadaya this would be a good improvement!

@augustobmoura
Copy link
Member

We changed the way aliases work on #348, now you need to explicitly opt-in with dynamic ranges on legacy version files (.tool-versions and .nvmrc). The .tool-versions file doesn't support non-deterministic versions, and supporting it on .tool-versions is not a feature we are seeking to implement at the moment.

To enable it, you need to provide an ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY environment variable choosing between the latest_available and latest_installed strategies, you can read more about it in the appropriate section on the README of the project. To make this choice permanent you can export said variable from your shell rc file like so:

export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed
# OR
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_available

Please update the plugin by running asdf plugin-update nodejs. If a new issue arises with the new implementation please open a new issue.

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

6 participants