{"record":{"id":"e97cc4df63d9df81","repo":"asdf-vm/asdf","slug":"unable-to-resolve-latest-version-for-s","errorCode":null,"errorMessage":"unable to resolve latest version for %s","messagePattern":"unable to resolve latest version for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cli/set/set.go","lineNumber":45,"sourceCode":"\n\tif home && parent {\n\t\treturn printError(stderr, \"home and parent flags cannot both be specified; must be one location or the other\")\n\t}\n\n\tconf, err := config.LoadConfig()\n\tif err != nil {\n\t\treturn printError(stderr, fmt.Sprintf(\"error loading config: %s\", err))\n\t}\n\n\tresolvedVersions := []string{}\n\n\tfor _, version := range args[1:] {\n\t\tparsedVersion := toolversions.ParseFromCliArg(version)\n\t\tif parsedVersion.Type == \"latest\" {\n\t\t\tplugin := plugins.New(conf, args[0])\n\t\t\tresolvedVersion, err := versions.Latest(plugin, parsedVersion.Value, stderr)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to resolve latest version for %s\", plugin.Name)\n\t\t\t}\n\t\t\tresolvedVersions = append(resolvedVersions, resolvedVersion)\n\t\t\tcontinue\n\t\t}\n\t\tresolvedVersions = append(resolvedVersions, version)\n\t}\n\n\ttv := toolversions.ToolVersions{Name: args[0], Versions: resolvedVersions}\n\n\tif home {\n\t\thomeDir, err := homeFunc()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfilepath := filepath.Join(homeDir, conf.DefaultToolVersionsFilename)\n\t\terr = toolversions.WriteToolVersionsToFile(filepath, []toolversions.ToolVersions{tv})\n\t\tif err != nil {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/cli/set/set.go#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"Using `latest` before installing the plugin; plugin repo broken or outdated so latest resolution fails; offline CI environments.","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."],"exampleFix":"# before\nasdf set nodejs latest   # resolution fails\n# after\nasdf plugin update nodejs\nasdf set nodejs latest   # or: asdf set nodejs 20.11.0","handlingStrategy":"validation","validationCode":"asdf plugin list | grep -qx \"$PLUGIN\" || asdf plugin add \"$PLUGIN\"\nasdf latest \"$PLUGIN\" >/dev/null || { echo \"cannot resolve latest for $PLUGIN\"; exit 1; }\nasdf set \"$PLUGIN\" latest","typeGuard":null,"tryCatchPattern":"if ! asdf set \"$PLUGIN\" latest 2>&1; then\n  asdf set \"$PLUGIN\" \"$PINNED_VERSION\"\nfi","preventionTips":["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"],"tags":["cli","versioning","resolution","config"],"backgroundTag":"version-resolution-failed","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}