jdx/mise · error

version should not be 'latest' for node, something is wrong

Error message

version should not be 'latest' for node, something is wrong

What it means

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.

Source

Thrown at src/plugins/core/node.rs:711

        let body = normalize_idiomatic_contents(&contents);

        let versions = body
            .lines()
            .map(|line| {
                let mut version = line.trim().strip_prefix('v').unwrap_or(line).to_string();
                version = version.replace("lts/*", "lts");
                version
            })
            .collect();
        Ok(versions)
    }

    async fn install_version_(
        &self,
        ctx: &InstallContext,
        mut tv: ToolVersion,
    ) -> eyre::Result<ToolVersion> {
        ensure!(
            tv.version != "latest",
            "version should not be 'latest' for node, something is wrong"
        );
        let settings = Settings::get();
        let opts = BuildOpts::new(ctx, &tv).await?;
        trace!("node build opts: {:#?}", opts);
        let platform_key = self.get_platform_key();
        let node_compile = if ctx.locked {
            settings.node_compile(CompilePurpose::Inspect)
        } else {
            settings.node_compile(CompilePurpose::Install)
        };
        let compile_from_source =
            should_compile_from_source(ctx.locked, &tv.lock_platforms, &platform_key, node_compile);

        if cfg!(windows) {
            self.install_windows(ctx, &mut tv, &opts).await?;
        } else if compile_from_source {

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Pin a concrete version instead: `mise use node@22` (or a specific lts codename)
  2. Update mise to the latest release — this message indicates a resolution bug that may be fixed
  3. If it persists, capture `mise doctor` output and the exact config and report it as a mise bug

Example fix

# before
mise install node@latest   # error: version should not be 'latest' for node

# after
mise install node@22.11.0
Defensive patterns

Strategy: validation

Validate before calling

# resolve to a concrete version before installing
v=$(mise ls-remote node | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | tail -1)
mise install "node@${v#v}"

Try / catch

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.

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/4b2464629fab8c6e. Report an issue: GitHub.