asdf-vm/asdf · error
No version is set for %s; please run `asdf set [options] %s
Error message
No version is set for %s; please run `asdf set [options] %s <version>`
What it means
`asdf where <tool>` could not resolve any version for the tool in the current directory or its config chain, so there is no install path to print. The message tells the user to run `asdf set` to pin a version.
Source
Thrown at internal/cli/cli.go:1551
versions, found, err := resolve.Version(conf, plugin, currentDir)
if err != nil {
fmt.Printf("err %#+v\n", err)
return err
}
if found && len(versions.Versions) > 0 {
versionStruct := toolversions.Version{Type: "version", Value: versions.Versions[0]}
if installs.IsInstalled(conf, plugin, versionStruct) {
installPath := installs.InstallPath(conf, plugin, versionStruct)
fmt.Printf("%s", installPath)
return nil
}
}
// not found
msg := fmt.Sprintf("No version is set for %s; please run `asdf set [options] %s <version>`", tool, tool)
logger.Print(msg)
return errors.New(msg)
}
if !installs.IsInstalled(conf, plugin, version) {
logger.Printf("Version not installed")
return errors.New("Version not installed")
}
installPath := installs.InstallPath(conf, plugin, version)
fmt.Printf("%s", installPath)
return nil
}
func loadPlugin(logger *log.Logger, conf config.Config, pluginName string) (plugins.Plugin, error) {
plugin := plugins.New(conf, pluginName)
err := plugin.Exists()
if err != nil {
logger.Printf("No such plugin: %s", pluginName)View on GitHub (pinned to 074a1722ca)
Solutions
- Pin a version in the current directory: `asdf set <tool> <version>` or add `<tool> <version>` to .tool-versions
- Set a default: add the tool+version to ~/.config/asdf/default (or ~/.tool-versions) so subdirectories resolve
- Confirm the tool name spelling matches the installed plugin name (`asdf plugin list`)
Example fix
// before (.tool-versions missing nodejs) python 3.12.1 // after python 3.12.1 nodejs 20.12.0
Defensive patterns
Strategy: validation
Validate before calling
if ! grep -qE "^$TOOL[[:space:]]+" .tool-versions 2>/dev/null \ && ! grep -qE "^$TOOL[[:space:]]+" ~/.config/asdf/default 2>/dev/null; then echo "no version set for $TOOL; run asdf set $TOOL <version>" >&2 fi
Try / catch
out=$(asdf where "$TOOL" 2>&1) || {
case "$out" in
*"No version is set"*) asdf set "$TOOL" "$DEFAULT_VER";;
*) echo "$out" >&2;;
esac
} Prevention
- Commit a .tool-versions to every project repo
- Set a global default for tools you use everywhere
- Check tool-name spelling against `asdf plugin list`
When it happens
Trigger: Running `asdf where <tool>` where resolve finds no version in .tool-versions (current or parent dirs) and no default version is configured.
Common situations: Fresh clones missing .tool-versions; tool name typo in .tool-versions; no global default set in ~/.tool-versions or asdf config after a fresh install.
Related errors
- System version is selected
- Version not installed
- command removed
- bad shell name
- no plugin name specified
AI-assisted analysis of asdf-vm/asdf@074a1722ca (2026-08-30).
Data as JSON: /api/errors/8eaea8de1931841c.
Report an issue: GitHub.