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 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.

Source

Thrown at src/system/packages/brew/cask.rs:799

                Some(version) => match &req.version {
                    Some(requested) if version != *requested => {
                        PackageState::VersionMismatch { installed: version }
                    }
                    _ => PackageState::Installed { version },
                },
                None => PackageState::Missing,
            };
            statuses.push(PackageStatus {
                request: req.clone(),
                state,
            });
        }
        Ok(statuses)
    }

    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> 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).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)).await {
                Ok(version) => {
                    pr.finish_with_message(version);
                    mpr.footer_inc(1);
                }
                Err(err) => {

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Drop the version from the request: request `brew-cask:foo` with no @version and no version string
  2. If you need a specific app version, install that version manually and keep it outside mise-managed casks

Example fix

# before
$ mise use brew-cask:firefox@128.0
error: brew casks are installed at their current version ('firefox@128.0')

# after
$ mise use brew-cask:firefox
Defensive patterns

Strategy: validation

Validate before calling

// Strip versions from brew-cask requests before invoking install:
let clean: Vec<PackageRequest> = pkgs.iter().filter(|p| p.version.is_none()).cloned().collect();
if clean.len() != pkgs.len() {
    return Err(eyre!("brew-cask requests must not pin versions; got: {:?}",
        pkgs.iter().filter(|p| p.version.is_some()).collect::<Vec<_>>()));
}

Type guard

fn is_unversioned_cask_request(p: &PackageRequest) -> bool {
    p.name.starts_with("brew-cask:") && p.version.is_none()
}

Try / catch

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.

Prevention

When it happens

Trigger: 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.

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

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/f3161711103e8d8c. Report an issue: GitHub.