jdx/mise · error

brew casks are installed at their current version ('{p}')

Error message

brew casks are installed at their current version ('{p}')

What it means

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.

Source

Thrown at src/system/packages/brew/cask/mod.rs:494

}

impl BrewCaskManager {
    pub(crate) fn new() -> Self {
        Self {}
    }

    /// Processes current-version cask requests in the selected install mode.
    /// Dry runs report decisions without staging; real runs report per-cask progress
    /// and stop at the first failure. Explicit version requests return an error.
    async fn install_with_manager_options(
        &self,
        pkgs: &[PackageRequest],
        opts: &InstallOpts,
        manager_options: &ManagerPackageOptions,
        mode: InstallMode,
    ) -> Result<()> {
        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {
            bail!("brew casks are installed at their current version ('{p}')");
        }
        if opts.dry_run {
            prefix::bootstrap(true)?;
            for pkg in pkgs {
                self.install_one(pkg, opts, None, manager_options, mode)
                    .await?;
            }
            return Ok(());
        }
        let mpr = MultiProgressReport::get();
        mpr.init_footer(false, "install", pkgs.len());
        for pkg in pkgs {
            let pr: Box<dyn SingleReport> = mpr.add(&format!("brew-cask:{}", pkg.name));
            match self
                .install_one(pkg, opts, Some(&*pr), manager_options, mode)
                .await
            {
                Ok(version) => {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Remove the version specifier and request the cask by token only
  2. If an older app version is truly needed, install the app manually or use an archived cask/old tap
  3. For reproducible environments, pin at the Homebrew/tap level rather than per-package

Example fix

// before
PackageRequest { name: "iterm2", version: Some("3.4.16") }
// after
PackageRequest { name: "iterm2", version: None }
Defensive patterns

Strategy: validation

Validate before calling

if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {
    return Err(format!("cask {} cannot be version-pinned", p.name));
}

Try / catch

match install(&pkgs).await {
    Err(e) if e.to_string().contains("installed at their current version") => {
        let unpinned: Vec<_> = pkgs.iter().map(|p| PackageRequest { version: None, ..p.clone() }).collect();
        install(&unpinned).await
    }
    r => r,
}

Prevention

When it happens

Trigger: 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()`.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/d88516d92a1798f2. Report an issue: GitHub.