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

asdf install nodejs lts fails on first attempt #329

Closed
sargunv opened this issue Jan 15, 2023 · 4 comments
Closed

asdf install nodejs lts fails on first attempt #329

sargunv opened this issue Jan 15, 2023 · 4 comments

Comments

@sargunv
Copy link

sargunv commented Jan 15, 2023

When I first install this nodejs plugin and then attempt asdf install nodejs lts, I get the error:

Cloning node-build
node-build: definition not found: lts

Re-running the same command works.

I can then replicate the issue again by asdf plugin remove nodejs and starting over.

image

@sargunv
Copy link
Author

sargunv commented Jan 15, 2023

Looks to be the same issue as #319, which was closed b/c they were using the alias in .tool-versions instead of via asdf install.

I can replicate this issue with both methods.

@sargunv
Copy link
Author

sargunv commented Jan 15, 2023

Figured it out: resolve_version_query in the install script requires node-build in order to resolve an alias, but node-build isn't installed/updated until after resolve_version_query is called.

Filing a PR to fix

@tenjaa
Copy link

tenjaa commented May 19, 2023

Ran into this today. Are there any updates on merging this fix?

@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

Successfully merging a pull request may close this issue.

3 participants