{"record":{"id":"d88516d92a1798f2","repo":"jdx/mise","slug":"brew-casks-are-installed-at-their-current-version-d88516","errorCode":null,"errorMessage":"brew casks are installed at their current version ('{p}')","messagePattern":"brew casks are installed at their current version \\('(.+?)'\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/mod.rs","lineNumber":494,"sourceCode":"}\n\nimpl BrewCaskManager {\n    pub(crate) fn new() -> Self {\n        Self {}\n    }\n\n    /// Processes current-version cask requests in the selected install mode.\n    /// Dry runs report decisions without staging; real runs report per-cask progress\n    /// and stop at the first failure. Explicit version requests return an error.\n    async fn install_with_manager_options(\n        &self,\n        pkgs: &[PackageRequest],\n        opts: &InstallOpts,\n        manager_options: &ManagerPackageOptions,\n        mode: InstallMode,\n    ) -> 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, manager_options, mode)\n                    .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\n                .install_one(pkg, opts, Some(&*pr), manager_options, mode)\n                .await\n            {\n                Ok(version) => {","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/mod.rs#L476-L512","documentation":"The brew cask backend refuses install requests that pin a specific version, because casks are always installed at whatever version Homebrew currently provides. It throws when any PackageRequest in the batch carries an explicit version, naming the offending request in the message.","triggerScenarios":"Calling install (e.g. `mise use brew:cask@<version>` style request or API install with `version: Some(...)`) where any pkg in `pkgs` has `version.is_some()`.","commonSituations":"Users trying to pin a macOS GUI app to an old cask version; scripts copied from brew-formula workflows that pass versions; mise tool-configuration files pinning cask versions.","solutions":["Remove the version specifier and request the cask by token only","If an older app version is truly needed, install the app manually or use an archived cask/old tap","For reproducible environments, pin at the Homebrew/tap level rather than per-package"],"exampleFix":"// before\nPackageRequest { name: \"iterm2\", version: Some(\"3.4.16\") }\n// after\nPackageRequest { name: \"iterm2\", version: None }","handlingStrategy":"validation","validationCode":"if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n    return Err(format!(\"cask {} cannot be version-pinned\", p.name));\n}","typeGuard":null,"tryCatchPattern":"match install(&pkgs).await {\n    Err(e) if e.to_string().contains(\"installed at their current version\") => {\n        let unpinned: Vec<_> = pkgs.iter().map(|p| PackageRequest { version: None, ..p.clone() }).collect();\n        install(&unpinned).await\n    }\n    r => r,\n}","preventionTips":["Never set `version` on brew cask package requests","Read brew cask docs: casks track current upstream releases only","Pin app versions via a custom tap or manual install instead"],"tags":["brew","cask","versioning","unsupported"],"backgroundTag":"unsupported-operation","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"}