jdx/mise · error

{bin_name} is not a valid shim. This likely means you uninst

Error message

{bin_name} is not a valid shim. This likely means you uninstalled a tool and the shim does not point to anything. Run `mise use <TOOL>` to reinstall the tool.

What it means

This error is thrown when resolving a shim's target binary and the toolset contains no versions for the tool the shim belongs to. It means the shim file exists but points at a tool that is no longer installed/active, so mise cannot resolve a real executable path. mise tells the user to reinstall the tool to restore a valid shim.

Source

Thrown at src/shims.rs:1798

    )
    .await?;
    file::make_executable_async(shim).await?;
    trace!(
        "shim created from {} to {}",
        target.display(),
        shim.display()
    );
    Ok(())
}

async fn err_no_version_set(
    config: &Arc<Config>,
    ts: Toolset,
    bin_name: &str,
    tvs: Vec<ToolVersion>,
) -> Result<PathBuf> {
    if tvs.is_empty() {
        bail!(
            "{bin_name} is not a valid shim. This likely means you uninstalled a tool and the shim does not point to anything. Run `mise use <TOOL>` to reinstall the tool."
        );
    }
    let missing_plugins = tvs.iter().map(|tv| tv.ba()).collect::<HashSet<_>>();
    let mut missing_tools = ts
        .list_missing_versions(config)
        .await
        .into_iter()
        .filter(|t| missing_plugins.contains(t.ba()))
        .collect_vec();
    if missing_tools.is_empty() {
        if let Some(msg) = unavailable_configured_tool_message(config, &ts, bin_name) {
            return Err(eyre!(msg));
        }
        let mut msg = format!("No version is set for shim: {bin_name}\n");
        msg.push_str("Set a global default version with one of the following:\n");
        for tv in tvs {
            msg.push_str(&format!("mise use -g {}@{}\n", tv.ba(), tv.version));

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run `mise use <TOOL>` (as the message says) to reinstall/set the tool and regenerate valid shims
  2. Run `mise install` to install any versions pinned in your config files
  3. Prune stale shims with `mise reshim` after fixing configs
  4. Check `mise ls` to see which tools have configured versions but no installed versions

Example fix

# before
$ mise uninstall node 2024.x
$ ./shims/node --version
# error: node is not a valid shim...

# after
$ mise use node@22
$ ./shims/node --version
v22.x.x
Defensive patterns

Strategy: validation

Validate before calling

# Before executing a shim, check the tool has an installed version
mise ls node || true
# Ensure config-pinned tools are installed
mise install

Type guard

// In code: resolve only when the toolset has versions
if tool_versions.is_empty() {
    eprintln!("no version set for {bin_name}; run `mise use <TOOL>`");
    std::process::exit(1);
}

Try / catch

match result {
    Err(e) if e.to_string().contains("is not a valid shim") => {
        // reinstall the tool and regenerate shims
        run("mise").args(["use", tool])?;
        run("mise").args(["reshim"])?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Executing or resolving a shim (via which_shim or err_shim_not_found) when err_no_version_set is reached with an empty tvs (ToolVersion) list — i.e. the shim exists on disk but no matching tool version is set by any config.

Common situations: A user ran `mise uninstall <tool>` (or the installed version was removed) while old shim files or config references remain; a mise.toml pins a tool that was never installed; stale shims left over after editing config files.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/c48986f7d8dc6cba. Report an issue: GitHub.