{"record":{"id":"f3161711103e8d8c","repo":"jdx/mise","slug":"brew-casks-are-installed-at-their-current-version","errorCode":null,"errorMessage":"brew casks are installed at their current version ('{p}')","messagePattern":"brew casks are installed at their current version \\('(.+?)'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":799,"sourceCode":"                Some(version) => match &req.version {\n                    Some(requested) if version != *requested => {\n                        PackageState::VersionMismatch { installed: version }\n                    }\n                    _ => PackageState::Installed { version },\n                },\n                None => PackageState::Missing,\n            };\n            statuses.push(PackageStatus {\n                request: req.clone(),\n                state,\n            });\n        }\n        Ok(statuses)\n    }\n\n    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n            bail!(\"brew casks are installed at their current version ('{p}')\");\n        }\n        if opts.dry_run {\n            prefix::bootstrap(true)?;\n            for pkg in pkgs {\n                self.install_one(pkg, opts, None).await?;\n            }\n            return Ok(());\n        }\n        let mpr = MultiProgressReport::get();\n        mpr.init_footer(false, \"install\", pkgs.len());\n        for pkg in pkgs {\n            let pr: Box<dyn SingleReport> = mpr.add(&format!(\"brew-cask:{}\", pkg.name));\n            match self.install_one(pkg, opts, Some(&*pr)).await {\n                Ok(version) => {\n                    pr.finish_with_message(version);\n                    mpr.footer_inc(1);\n                }\n                Err(err) => {","sourceCodeStart":781,"sourceCodeEnd":817,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/packages/brew/cask.rs#L781-L817","documentation":"The brew-cask backend installs casks at whatever version the tap currently publishes — casks have no version selection. If any incoming PackageRequest carries a pinned version, the whole batch is rejected up front with this error naming the offending request, before any install work starts.","triggerScenarios":"Attaching a version to a brew-cask request anywhere: `mise use brew-cask:foo@1.2.3`, a config entry mapping a cask to a version string, or a lockfile that carries a version for a brew-cask package.","commonSituations":"Users assuming casks behave like formulae or dev tools with semver pins; copying versioned tool entries into cask entries; migration scripts that add versions uniformly.","solutions":["Drop the version from the request: request `brew-cask:foo` with no @version and no version string","If you need a specific app version, install that version manually and keep it outside mise-managed casks"],"exampleFix":"# before\n$ mise use brew-cask:firefox@128.0\nerror: brew casks are installed at their current version ('firefox@128.0')\n\n# after\n$ mise use brew-cask:firefox","handlingStrategy":"validation","validationCode":"// Strip versions from brew-cask requests before invoking install:\nlet clean: Vec<PackageRequest> = pkgs.iter().filter(|p| p.version.is_none()).cloned().collect();\nif clean.len() != pkgs.len() {\n    return Err(eyre!(\"brew-cask requests must not pin versions; got: {:?}\",\n        pkgs.iter().filter(|p| p.version.is_some()).collect::<Vec<_>>()));\n}","typeGuard":"fn is_unversioned_cask_request(p: &PackageRequest) -> bool {\n    p.name.starts_with(\"brew-cask:\") && p.version.is_none()\n}","tryCatchPattern":"Catch the 'installed at their current version' bail at config-load time and reject the file with a pointer to the offending entry, so users learn before any install starts.","preventionTips":["Never write @version suffixes or version strings for brew-cask entries","Treat casks as always-latest: put version-sensitive tools under normal versioned backends"],"tags":["homebrew","cask","version-pin","mise","config"],"backgroundTag":"version-pin-unsupported","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}