{"record":{"id":"4b2464629fab8c6e","repo":"jdx/mise","slug":"version-should-not-be-latest-for-node-something","errorCode":null,"errorMessage":"version should not be 'latest' for node, something is wrong","messagePattern":"version should not be 'latest' for node, something is wrong","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/node.rs","lineNumber":711,"sourceCode":"        let body = normalize_idiomatic_contents(&contents);\n\n        let versions = body\n            .lines()\n            .map(|line| {\n                let mut version = line.trim().strip_prefix('v').unwrap_or(line).to_string();\n                version = version.replace(\"lts/*\", \"lts\");\n                version\n            })\n            .collect();\n        Ok(versions)\n    }\n\n    async fn install_version_(\n        &self,\n        ctx: &InstallContext,\n        mut tv: ToolVersion,\n    ) -> eyre::Result<ToolVersion> {\n        ensure!(\n            tv.version != \"latest\",\n            \"version should not be 'latest' for node, something is wrong\"\n        );\n        let settings = Settings::get();\n        let opts = BuildOpts::new(ctx, &tv).await?;\n        trace!(\"node build opts: {:#?}\", opts);\n        let platform_key = self.get_platform_key();\n        let node_compile = if ctx.locked {\n            settings.node_compile(CompilePurpose::Inspect)\n        } else {\n            settings.node_compile(CompilePurpose::Install)\n        };\n        let compile_from_source =\n            should_compile_from_source(ctx.locked, &tv.lock_platforms, &platform_key, node_compile);\n\n        if cfg!(windows) {\n            self.install_windows(ctx, &mut tv, &opts).await?;\n        } else if compile_from_source {","sourceCodeStart":693,"sourceCodeEnd":729,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/plugins/core/node.rs#L693-L729","documentation":"Internal invariant in the node core plugin: by the time install_version_ runs, the version string must be concrete — `latest` and `lts/*` should already have been resolved to a real version/lts codename by the request-resolution layer. Seeing this error means resolution failed to substitute `latest`, i.e. a mise bug or an unusual alias/override path.","triggerScenarios":"`mise install node@latest` (or a config entry `node = \"latest\"`) where version resolution does not replace the alias before install — e.g. a regression in alias resolution, stale hand-edited aliases, or a custom override forcing the literal string.","commonSituations":"After upgrading/downgrading mise versions with mismatched alias logic; stale files under the aliases dir; config forcing `node = \"latest\"` in an unusual way. For most users `node@latest` resolves correctly and this never fires.","solutions":["Pin a concrete version instead: `mise use node@22` (or a specific lts codename)","Update mise to the latest release — this message indicates a resolution bug that may be fixed","If it persists, capture `mise doctor` output and the exact config and report it as a mise bug"],"exampleFix":"# before\nmise install node@latest   # error: version should not be 'latest' for node\n\n# after\nmise install node@22.11.0","handlingStrategy":"validation","validationCode":"# resolve to a concrete version before installing\nv=$(mise ls-remote node | grep -E '^v?[0-9]+\\.[0-9]+\\.[0-9]+$' | tail -1)\nmise install \"node@${v#v}\"","typeGuard":null,"tryCatchPattern":"If this error appears, do not retry the same request — capture `mise doctor`, switch to a pinned concrete version, and report the resolution bug upstream.","preventionTips":["Pin concrete versions in configs consumed by CI","Keep mise updated so alias-resolution fixes land"],"tags":["node","invariant","version-resolution","core-plugin"],"backgroundTag":"unresolved-version-alias","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}