jdx/mise · error
invalid tool version request: {s}
Error message
invalid tool version request: {s} What it means
ToolRequest::new_with_options parses a tool version string like 'node@22' or 'node@latest'. If the string doesn't match any recognized request syntax (no @/path/ref/etc. form), parsing falls through to the catch-all bail with this message, since mise cannot interpret the request.
Source
Thrown at src/toolset/tool_request.rs:168
}
None => {
if s == "system" {
Self::System {
options,
backend,
source,
}
} else {
validate_version_string(&s)?;
Self::Version {
version: s,
options,
backend,
source,
}
}
}
_ => 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,
}View on GitHub (pinned to afd2eddd3a)
Solutions
- Use valid syntax 'tool@version' or 'tool@latest' in config/CLI (e.g. node@22.0.0)
- Check the exact string being passed — log it if it comes from a script or env var
- Trim whitespace and remove stray characters around the version spec
- Consult `mise registry` for correct tool names and valid version formats
Example fix
// before [tools] node = 'lts unsupported' // after [tools] node = '22'
Defensive patterns
Strategy: validation
Validate before calling
// validate spec shape before creating a request
const validSpec = (s) => /^[^@\s]+@([^@\s]+)$/.test(s.trim());
if (!validSpec(spec)) throw new Error('bad spec: '+spec); Type guard
const isToolSpec = (v) => typeof v === 'string' && v.includes('@') && !v.trim().endsWith('@'); Try / catch
try { req = ToolRequest.newWithOptions(spec, opts) } catch (e) { if (String(e).startsWith('invalid tool version request')) { printUsageAndExit(1); } else { throw e; } } Prevention
- Always use 'tool@version' syntax with a non-empty version
- Trim whitespace from interpolated values
- Don't pass raw user input as version specs without validation
- Check tool names with `mise registry`
When it happens
Trigger: Passing a malformed version spec to ToolRequest::new_with_options — e.g. calling the API/CLI with 'node' when a version is required, a typo'd prefix, or an unsupported syntax form in tools config.
Common situations: Typos in mise.toml tools entries (missing '@version'), invalid specs like 'node@' with empty version or stray characters, scripts passing user input straight into `mise use` or ToolRequest.
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
- rustc identity is missing its version
- no version specified for tool {tool}\nuse `mise shell {tool}
- relay unavailable
- trimV requires exactly 1 argument
- the release list of packslip:{project} has no version {}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/697b34b31b9ced83.
Report an issue: GitHub.