jdx/mise · error
invalid tool version request
Error message
invalid tool version request: {s} What it means
`ToolRequest::new_with_options` parses a tool version string like `node@20` or `node:20`. If the string doesn't match any accepted grammar, it bails with this message echoing the input. It is the validation gate for all tool version requests built from user/config strings.
Solutions
- Fix the version string to the expected `tool@version` form, e.g. `node@20.0.0` or `node@latest`.
- Check for unexpanded shell variables or quoting issues in the config.
- Verify the syntax supports your intent (prefixes, latest, ref:, etc.) per mise docs.
- Run `mise ls-remote <tool>` to confirm valid version names before pinning.
Example fix
// before [tools] node = "" // after [tools] node = "20"
Defensive patterns
Strategy: validation
Validate before calling
fn valid_request(s: &str) -> bool { let s = s.trim(); s.contains('@') && !s.ends_with('@') && !s.split('@').next().unwrap().is_empty() } Prevention
- Validate tool@version strings before writing them into config files.
- Quote version strings in shell-generated configs to avoid empty interpolations.
- Test config edits with a mise command that parses the toolset before committing.
When it happens
Trigger: Passing a malformed version string to toolset construction/config parsing — e.g. missing `@`, unsupported prefix (`ref:`, `sub-` misuse), stray whitespace, or an otherwise unparsable form like `node@` or `nod e@20`.
Common situations: Typo in a mise.toml `[tools]` entry or `.tool-versions` line; shell interpolation producing an empty version (`node@$VERSION` with unset VERSION); copy-pasted strings with quotes or spaces.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- expected value of to be a , got
- invalid lockfile format for tool
- invalid system package spec
- unrecognized attested_by
- unrecognized github_attestations status
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/697b34b31b9ced83.
Report an issue: GitHub.
Appendix: source
Thrown at src/toolset/tool_request.rs:191
if s == "system" {
Self::System {
options,
backend,
source,
lockfile_scope: LockfileScope::Default,
}
} else {
validate_version_string(&s)?;
Self::Version {
version: s,
options,
backend,
source,
lockfile_scope: LockfileScope::Default,
}
}
}
_ => bail!("invalid tool version request: {s}"),
})
}
/// Construct an unvalidated version request for tests that exercise paths
/// derived from otherwise-invalid version strings.
#[cfg(test)]
pub(crate) fn new_version_for_test(
backend: Arc<BackendArg>,
version: &str,
source: ToolSource,
) -> Self {
let options = backend.resolve_opts_with_config_and_request(None, None);
Self::Version {
backend,
version: version.to_string(),
options,
source,
lockfile_scope: LockfileScope::Default,View on GitHub (pinned to 533346cc37)