{"record":{"id":"8d0f0180f52787ce","repo":"jdx/mise","slug":"invalid-version","errorCode":null,"errorMessage":"invalid version: {}","messagePattern":"invalid version: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/latest.rs","lineNumber":71,"sourceCode":"}\n\nimpl Latest {\n    pub(crate) async fn run(self) -> Result<()> {\n        let before_date = self.get_before_date()?;\n        let config = Config::get().await?;\n        let Self {\n            tool,\n            asdf_version,\n            installed,\n            minimum_release_age: _,\n        } = self;\n        let prefix = match &tool.tvr {\n            None => asdf_version,\n            Some(ToolRequest::Version { version, .. }) => Some(version.clone()),\n            // `sub-N:<base>` resolves its base against the backend, so it is handled\n            // below once the backend (and its plugin) is ready.\n            Some(ToolRequest::Sub { .. }) => None,\n            _ => bail!(\"invalid version: {}\", tool.style()),\n        };\n\n        let ba = prefix\n            .as_deref()\n            .and_then(|prefix| tool.ba.with_registry_version(prefix));\n        let ba = ba.as_ref().unwrap_or(&tool.ba);\n        let mut backend = ba.backend()?;\n        let mpr = MultiProgressReport::get();\n        if let Some(plugin) = backend.plugin() {\n            plugin.ensure_installed(&config, &mpr, false, false).await?;\n            backend = ba.backend()?;\n        }\n        let prefix = match &tool.tvr {\n            Some(ToolRequest::Sub {\n                sub, orig_version, ..\n            }) => Some(\n                resolve_sub_base(&config, &backend, sub, orig_version, before_date, false).await?,\n            ),","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/latest.rs#L53-L89","documentation":"This error is thrown by the `mise latest` command when the tool request is not a plain version, prefix-less request, or `sub-N:<base>` request — i.e. the version spec cannot be reduced to a registry-version prefix. Only concrete versions and supported prefix forms are meaningful for 'latest' lookup; other request kinds (e.g. path or ref requests) are rejected.","triggerScenarios":"Running `mise latest` with a tool argument that parses to an unsupported ToolRequest variant, such as a ref:... request, a path-based spec, or other non-version syntax.","commonSituations":"Passing `ref:main` or a git/path spec to `mise latest` expecting it to resolve a latest version; copy-pasting a complex version spec from .tool-versions that latest doesn't support.","solutions":["Pass a plain version or prefix instead, e.g. mise latest node@22 or mise latest node@22.1","For refs or paths, use the appropriate command (mise install / mise use) rather than mise latest","Check the spec with mise ls-remote <tool> to see supported version forms"],"exampleFix":"// before\nmise latest node@ref:main\n// after\nmise latest node@22","handlingStrategy":"validation","validationCode":"SPEC=\"$1\"\ncase \"$SPEC\" in\n  *ref:*|*path:*|*sub-*) echo \"mise latest needs a plain version/prefix, not '$SPEC'\" >&2; exit 1 ;;\n  *) ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call mise latest with plain versions or prefixes (node@22, node@22.1)","Use mise ls-remote to explore valid version strings first","Handle refs/paths with mise install or mise use, not mise latest"],"tags":["cli","version-resolution","latest"],"backgroundTag":"invalid-cli-argument","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}