jdx/mise · error

must provide a version for {}

Error message

must provide a version for {}

What it means

`mise link` requires the tool argument to carry a version (TOOL@VERSION). When the arg parses to a tool with no version request at all (just `node`), there is nothing to name the linked directory after, so it bails with 'must provide a version'. Unlike the alias cases, this one fires before any config lookup.

Source

Thrown at src/cli/link.rs:42

    /// The local path to the tool version
    /// e.g.: ~/.nvm/versions/node/v20.0.0
    #[clap(value_hint = ValueHint::DirPath, verbatim_doc_comment)]
    path: PathBuf,

    /// Overwrite an existing tool version if it exists
    #[clap(long, short = 'f')]
    force: bool,
}

impl Link {
    pub async fn run(self) -> Result<()> {
        let tvr = match self.tool.tvr.as_ref() {
            Some(tvr @ (ToolRequest::Version { .. } | ToolRequest::Ref { .. })) => tvr,
            Some(tvr) => bail!(
                "mise link only supports concrete versions and refs, not {}",
                tvr.version()
            ),
            None => bail!("must provide a version for {}", self.tool.style()),
        };
        let config = Config::get().await?;
        let version_pathname = match tvr {
            ToolRequest::Version { version, .. } => {
                let backend = tvr.backend()?;
                let resolved_alias = config.resolve_alias(&backend, version).await?;
                if version == "latest"
                    || resolved_alias != *version
                    || backend.is_rolling_channel(version)
                {
                    bail!(
                        "mise link only supports concrete versions and refs, not {}",
                        tvr.version()
                    );
                }
                ToolVersion::new(tvr.clone(), version.clone()).tv_pathname()
            }
            ToolRequest::Ref { .. } => ToolVersion::new(tvr.clone(), tvr.version()).tv_pathname(),

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Add an explicit version: `mise link node@22.17.1 /opt/node-22`
  2. Resolve dynamically: `mise link node@$(mise latest node) /opt/node-22`
  3. Check wrapper scripts interpolate the version correctly before invoking mise link

Example fix

# before
mise link node /opt/node-v22
# after
mise link node@22.17.1 /opt/node-v22
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
[[ "$arg" == *@* ]] || { echo "mise link requires TOOL@VERSION" >&2; exit 2; }
mise link "$arg" "$path"

Try / catch

mise link "$tool" "$path" 2>err.log || { grep -q 'must provide a version' err.log && mise link "$tool@$(mise latest "$tool")" "$path"; }

Prevention

When it happens

Trigger: `mise link node /opt/node` (forgot @version); a wrapper script that concatenates tool and version with a missing '@'; env var for the version being empty so the arg degrades to the bare tool name.

Common situations: First-time use of mise link assuming it picks the installed/latest version; shell variable mistakes like `mise link node@$V` with V unset (which usually fails parsing earlier, but tool-only args always land here).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/ef4586ecf23cb566. Report an issue: GitHub.