{"record":{"id":"c48986f7d8dc6cba","repo":"jdx/mise","slug":"bin-name-is-not-a-valid-shim-this-likely-means","errorCode":null,"errorMessage":"{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.","messagePattern":"(.+?) 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\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shims.rs","lineNumber":1798,"sourceCode":"    )\n    .await?;\n    file::make_executable_async(shim).await?;\n    trace!(\n        \"shim created from {} to {}\",\n        target.display(),\n        shim.display()\n    );\n    Ok(())\n}\n\nasync fn err_no_version_set(\n    config: &Arc<Config>,\n    ts: Toolset,\n    bin_name: &str,\n    tvs: Vec<ToolVersion>,\n) -> Result<PathBuf> {\n    if tvs.is_empty() {\n        bail!(\n            \"{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.\"\n        );\n    }\n    let missing_plugins = tvs.iter().map(|tv| tv.ba()).collect::<HashSet<_>>();\n    let mut missing_tools = ts\n        .list_missing_versions(config)\n        .await\n        .into_iter()\n        .filter(|t| missing_plugins.contains(t.ba()))\n        .collect_vec();\n    if missing_tools.is_empty() {\n        if let Some(msg) = unavailable_configured_tool_message(config, &ts, bin_name) {\n            return Err(eyre!(msg));\n        }\n        let mut msg = format!(\"No version is set for shim: {bin_name}\\n\");\n        msg.push_str(\"Set a global default version with one of the following:\\n\");\n        for tv in tvs {\n            msg.push_str(&format!(\"mise use -g {}@{}\\n\", tv.ba(), tv.version));","sourceCodeStart":1780,"sourceCodeEnd":1816,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/shims.rs#L1780-L1816","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `mise use <TOOL>` (as the message says) to reinstall/set the tool and regenerate valid shims","Run `mise install` to install any versions pinned in your config files","Prune stale shims with `mise reshim` after fixing configs","Check `mise ls` to see which tools have configured versions but no installed versions"],"exampleFix":"# before\n$ mise uninstall node 2024.x\n$ ./shims/node --version\n# error: node is not a valid shim...\n\n# after\n$ mise use node@22\n$ ./shims/node --version\nv22.x.x","handlingStrategy":"validation","validationCode":"# Before executing a shim, check the tool has an installed version\nmise ls node || true\n# Ensure config-pinned tools are installed\nmise install","typeGuard":"// In code: resolve only when the toolset has versions\nif tool_versions.is_empty() {\n    eprintln!(\"no version set for {bin_name}; run `mise use <TOOL>`\");\n    std::process::exit(1);\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"is not a valid shim\") => {\n        // reinstall the tool and regenerate shims\n        run(\"mise\").args([\"use\", tool])?;\n        run(\"mise\").args([\"reshim\"])?;\n    }\n    other => other?,\n}","preventionTips":["Run `mise install` after pulling config changes so pinned tools always exist","Avoid manually deleting tool versions from ~/.local/share/mise; use `mise uninstall`","Run `mise reshim` after uninstalling tools to prune stale shims","Use `mise doctor` to spot config/tools inconsistencies"],"tags":["shims","uninstalled-tool","stale-state"],"backgroundTag":"resource-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}