asdf-vm/asdf · error
unable to resolve latest version for %s
Error message
unable to resolve latest version for %s
What it means
asdf set resolves `latest` arguments to concrete versions before writing them to config. If versions.Latest fails to resolve a latest version for the named plugin, Main returns "unable to resolve latest version for <plugin>", so the set operation is aborted.
Source
Thrown at internal/cli/set/set.go:45
if home && parent {
return printError(stderr, "home and parent flags cannot both be specified; must be one location or the other")
}
conf, err := config.LoadConfig()
if err != nil {
return printError(stderr, fmt.Sprintf("error loading config: %s", err))
}
resolvedVersions := []string{}
for _, version := range args[1:] {
parsedVersion := toolversions.ParseFromCliArg(version)
if parsedVersion.Type == "latest" {
plugin := plugins.New(conf, args[0])
resolvedVersion, err := versions.Latest(plugin, parsedVersion.Value, stderr)
if err != nil {
return fmt.Errorf("unable to resolve latest version for %s", plugin.Name)
}
resolvedVersions = append(resolvedVersions, resolvedVersion)
continue
}
resolvedVersions = append(resolvedVersions, version)
}
tv := toolversions.ToolVersions{Name: args[0], Versions: resolvedVersions}
if home {
homeDir, err := homeFunc()
if err != nil {
return err
}
filepath := filepath.Join(homeDir, conf.DefaultToolVersionsFilename)
err = toolversions.WriteToolVersionsToFile(filepath, []toolversions.ToolVersions{tv})
if err != nil {View on GitHub (pinned to 074a1722ca)
Solutions
- Ensure the plugin is added: `asdf plugin add <plugin>` and updated: `asdf plugin update <plugin>`.
- Pin an explicit version instead: `asdf set <plugin> 20.11.0`.
- Check network connectivity in CI and retry.
- Inspect the underlying error by running `asdf latest <plugin>` to see why resolution fails.
Example fix
# before asdf set nodejs latest # resolution fails # after asdf plugin update nodejs asdf set nodejs latest # or: asdf set nodejs 20.11.0
Defensive patterns
Strategy: validation
Validate before calling
asdf plugin list | grep -qx "$PLUGIN" || asdf plugin add "$PLUGIN"
asdf latest "$PLUGIN" >/dev/null || { echo "cannot resolve latest for $PLUGIN"; exit 1; }
asdf set "$PLUGIN" latest Try / catch
if ! asdf set "$PLUGIN" latest 2>&1; then asdf set "$PLUGIN" "$PINNED_VERSION" fi
Prevention
- Install and update plugins before using `latest` in asdf set
- Pin explicit versions in CI to avoid resolution dependency
- Pre-check resolution with `asdf latest <plugin>`
- Ensure network availability where latest resolution requires remote listing
When it happens
Trigger: Running `asdf set <plugin> latest` (or `asdf global/local <plugin> latest`) where the plugin cannot resolve a latest version — e.g. plugin not installed, no network, or the plugin's list-all/latest callbacks fail.
Common situations: Using `latest` before installing the plugin; plugin repo broken or outdated so latest resolution fails; offline CI environments.
Related errors
- No compatible versions available (%s %s)
- command removed
- bad shell name
- no plugin name specified
- must provide command
AI-assisted analysis of asdf-vm/asdf@074a1722ca (2026-08-30).
Data as JSON: /api/errors/e97cc4df63d9df81.
Report an issue: GitHub.