{"record":{"id":"ef4586ecf23cb566","repo":"jdx/mise","slug":"must-provide-a-version-for","errorCode":null,"errorMessage":"must provide a version for {}","messagePattern":"must provide a version for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/link.rs","lineNumber":55,"sourceCode":"    /// The local path to the tool version\n    /// e.g.: ~/.nvm/versions/node/v20.0.0\n    #[usage(value_hint = ValueHint::DirPath, verbatim_doc_comment)]\n    path: PathBuf,\n\n    /// Overwrite an existing tool version if it exists\n    #[usage(long, short = 'f')]\n    force: bool,\n}\n\nimpl Link {\n    pub(crate) async fn run(self) -> Result<()> {\n        let tvr = match self.tool.tvr.as_ref() {\n            Some(tvr @ (ToolRequest::Version { .. } | ToolRequest::Ref { .. })) => tvr,\n            Some(tvr) => bail!(\n                \"mise link only supports concrete versions and refs, not {}\",\n                tvr.version()\n            ),\n            None => bail!(\"must provide a version for {}\", self.tool.style()),\n        };\n        let config = Config::get().await?;\n        let version_pathname = match tvr {\n            ToolRequest::Version { version, .. } => {\n                let backend = tvr.backend()?;\n                let resolved_alias = config.resolve_alias(&backend, version).await?;\n                if version == \"latest\"\n                    || resolved_alias != *version\n                    || backend.is_rolling_channel(version)\n                {\n                    bail!(\n                        \"mise link only supports concrete versions and refs, not {}\",\n                        tvr.version()\n                    );\n                }\n                ToolVersion::new(tvr.clone(), version.clone()).tv_pathname()\n            }\n            ToolRequest::Ref { .. } => ToolVersion::new(tvr.clone(), tvr.version()).tv_pathname(),","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/link.rs#L37-L73","documentation":"`mise link` creates a symlink exposing a local path as an installed tool version, which requires a concrete version or ref to name the install directory. If the tool request omits a version entirely (only the backend/name was given), mise cannot derive where to link, so it throws this error naming the tool request.","triggerScenarios":"Running `mise link <tool> --path <path>` without a version argument, e.g. `mise link node ./my-node` instead of `mise link node@22.1.0 ./my-node`, so `self.tool.tvr` is None.","commonSituations":"Users forgetting the `@version` suffix because `mise install node` works without one; scripts built for `mise use`/`mise install` syntax reused for `mise link`.","solutions":["Add a concrete version to the tool argument: `mise link node@22.1.0 /path/to/dir`","Use a ref form if linking a source checkout: `mise link node@ref:main /path/to/dir`","Check `mise ls-remote <tool>` for a valid version string to use"],"exampleFix":"// before\nmise link node ./node-build\n// after\nmise link node@22.1.0 ./node-build","handlingStrategy":"validation","validationCode":"// bash: ensure a version is present before linking\n[[ \"$1\" == *@* || \"$1\" == *@ref:* ]] || { echo \"usage: mise link <tool>@<version> <path>\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass tool@version form to `mise link`","Script wrappers should validate the argument contains @ before invoking mise"],"tags":["cli","link","missing-version","tool-management"],"backgroundTag":"missing-required-argument","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}