Open jabkoo opened 1 year ago
Ok, I fixed that with adding ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
variable to my .zshrc
, I guess that is how it is supposed to work?
However, it is really confusing, because I'm not using any legacy files like .node-version
or .nvmrc
. I just wanted to be able to resolve latest lts version from the command line with asdf nodejs resolve lts
, so I wouldn't have guessed I need to set ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY variable just for that.
@augustobmoura Is this behaviour intended?
The README states "This option is only available for legacy version files". So, it does not work with .tools-version
. IMHO it is a good decision.
.tools-version
file..nvmrc
instead of .tools-version
.Most of my projects are using .nvmrc
, and need to switch a lot. I use "latest_installed" to gain more control in my local env. It is smooth, so far.
this is now happening with v20. It's a broken behavior imo. When trying to install latest lts version using the command that asdf says to use: "asdf install nodejs lts" it errors out node-build: definition not found: 20
I tried adding ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
and that didn't help
this is now happening with v20. It's a broken behavior imo. When trying to install latest lts version using the command that asdf says to use: "asdf install nodejs lts" it errors out
node-build: definition not found: 20
I tried adding
ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
and that didn't help
I agree, this is definitely broken behaviour, or incorrect docs (i.e. following the documentation leads to an error).
Ok, I fixed that with adding
ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
variable to my.zshrc
, I guess that is how it is supposed to work?However, it is really confusing, because I'm not using any legacy files like
.node-version
or.nvmrc
. I just wanted to be able to resolve latest lts version from the command line withasdf nodejs resolve lts
, so I wouldn't have guessed I need to set ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY variable just for that.@augustobmoura Is this behaviour intended?
We could've the command fail if you don't provide either ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY
or a flag forcing a strategy. The idea is that by default it should follow your strategy of preference, from the variable.
I will work on making failing when no variable is passed the default behavior
Describe the Bug
When trying to resolve latest lts node version, I'm getting the result I was not expecting. When I run
asdf nodejs resolve lts
it only outputs a current major number18
instead of a full version specified:18.18.0
. I get the same result when runningasdf nodejs resolve lts --latest-available
. Weirdly enough, runningasdf nodejs resolve lts --latest-installed
returns full version, so18.18.0
, even though I have no node versions installed yet (I am assuming it is using latest available version as a fallback?).That is also causing
asdf install nodejs lts
not working, because it cannot resolve version18
.Steps to Reproduce
Run:
asdf install nodejs lts
asdf nodejs resolve lts
asdf nodejs resolve lts --latest-available
Expected Behaviour
Command
asdf nodejs resolve lts
should output full semantic version of latest available LTS Node version andasdf install nodejs lts
should be able to install it. As of 2023-10-02 it should output18.18.0
Actual Behaviour
Only major version number is printed
This causes
asdf install nodejs lts
to fail. It needs full version specified withMAJOR.MINOR.PATCH
Environment
asdf plugins affected (if relevant)
nodejs