jdx/mise · error

mise link only supports concrete versions and refs, not

Error message

mise link only supports concrete versions and refs, not {}

What it means

This error is thrown by the `mise link` command when the tool argument resolves to a ToolRequest other than a concrete Version or Ref. Linking a local checkout into mise's installs directory requires a concrete version (or ref) to name the install directory; prefix, sub, or latest-style specs cannot be linked.

Solutions

  1. Pass a concrete version: mise link node 22.3.0 --path /path/to/build
  2. Use a ref form if linking from a source checkout: mise link node@ref:abc123 --path ...
  3. Resolve the version first (e.g. mise ls-remote) and pass the exact version string

Example fix

// before
mise link node@latest --path ~/src/node
// after
mise link node 22.3.0 --path ~/src/node
Defensive patterns

Strategy: validation

Validate before calling

SPEC="$1"
if [[ "$SPEC" == "latest" || "$SPEC" == *"@latest" ]]; then
  echo "mise link requires a concrete version or ref, not '$SPEC'" >&2
  exit 1
fi

Prevention

When it happens

Trigger: Running `mise link <tool>@latest`, `mise link <tool>@22`, or any non-version/non-ref spec; also passing no version at all (which throws the adjacent 'must provide a version' bail).

Common situations: Users assuming link accepts 'latest' like install does; linking with a prefix version ('22') that resolves to a ToolRequest::Prefix rather than a concrete version; script variables containing 'latest' interpolated into the link command.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/5f60b9aca66f9c4e. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/link.rs:51

    /// Tool name and version to create a symlink for
    #[usage(value_name = "TOOL@VERSION")]
    tool: ToolArg,

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

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

impl Link {
    pub(crate) 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()
                    );

View on GitHub (pinned to 533346cc37)