{"record":{"id":"33373bd078688d92","repo":"jdx/mise","slug":"no-version-specified-for-tool-tool-nuse-mise-sh","errorCode":null,"errorMessage":"no version specified for tool {tool}\\nuse `mise shell {tool}@VERSION` to set a version","messagePattern":"no version specified for tool (.+?)\\\\nuse `mise shell (.+?)@VERSION` to set a version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/shell.rs","lineNumber":62,"sourceCode":"            err_inactive()?;\n        }\n\n        let shell = require_shell(\n            None,\n            &format!(\"Re-run `mise activate {EXAMPLE_SHELL}` in your shell rc file.\"),\n        )?;\n\n        if self.unset {\n            for ta in &self.tool {\n                let op = shell.unset_env(&tool_env_var_name(&ta.ba.short));\n                print!(\"{op}\");\n            }\n            return Ok(());\n        }\n\n        for ta in &self.tool {\n            if ta.tvr.is_none() {\n                bail!(\n                    \"no version specified for tool {tool}\\nuse `mise shell {tool}@VERSION` to set a version\",\n                    tool = ta.ba.short,\n                );\n            }\n        }\n\n        let mut ts = ToolsetBuilder::new()\n            .with_args(&self.tool)\n            .build(&config)\n            .await?;\n        let opts = InstallOptions {\n            force: false,\n            jobs: self.jobs,\n            raw: self.raw,\n            ..Default::default()\n        };\n        let (_, missing) = ts.install_missing_versions(&mut config, &opts).await?;\n        ts.notify_missing_versions(missing);","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cli/shell.rs#L44-L80","documentation":"`mise shell` sets per-session tool versions by exporting env vars like MISE_NODE_VERSION via the activate hook; each TOOL argument must be TOOL@VERSION because the whole point is pinning a concrete version in the current session. The loop over self.tool bails on the first ToolArg whose tvr (tool version request) is None — unless --unset was given, which is checked first. The command also requires an activated session and a detectable shell before reaching this check.","triggerScenarios":"Running `mise shell node` (no @VERSION) inside an activated session; passing a bare tool name when intending to pin a version; note `mise shell -u node` (unset) is the valid form without a version.","commonSituations":"Muscle memory from `mise use node`-style commands; forgetting the @ syntax in shell rc snippets or docs copied from `mise use` examples; scripting session setup quickly.","solutions":["Include the version exactly as the message hints: `mise shell node@22`","To remove a session pin instead, use the unset form: `mise shell --unset node`","For a persistent per-project version, use `mise use node@22` (writes config) rather than `mise shell`"],"exampleFix":"# before\nmise shell node   # no version specified for tool node; use `mise shell node@VERSION`\n\n# after\nmise shell node@22\n# to clear it later:\nmise shell -u node","handlingStrategy":"validation","validationCode":"# require TOOL@VERSION before calling mise shell\nfor t in \"$@\"; do\n  case \"$t\" in\n    *@*) ;;\n    *) echo \"usage: mise shell TOOL@VERSION (got: $t)\" >&2; exit 2;;\n  esac\ndone\nmise shell \"$@\"","typeGuard":"has_version_spec() { case \"$1\" in *@*) return 0;; *) return 1;; esac; }","tryCatchPattern":"Catch 'no version specified', append @<version> to the offending tool (named in the message), and rerun once; if the intent was clearing the pin, rerun with `mise shell -u <tool>`.","preventionTips":["Remember `mise shell` always pins: TOOL@VERSION, no exceptions except --unset","Use `mise use` for persistent versions and `mise shell` for session pins","Guard wrapper scripts with a TOOL@* pattern check"],"tags":["shell","version","arguments","activate","mise"],"backgroundTag":"missing-version-specifier","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}