jdx/mise · error

brew-cask:{}: conflicts with installed cask {}

Error message

brew-cask:{}: conflicts with installed cask {}

What it means

Homebrew cask JSON may declare `conflicts_with.cask` — tokens that must not coexist with this cask. mise reads each conflicting token's Caskroom directory; if any version directories are present there, installation is refused with this error before anything is downloaded or modified.

Source

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

            bail!("brew-cask:{}: dependency cycle detected", cask.token);
        }
        let mut ancestors = ancestors.clone();
        ancestors.insert(cask.token.clone());
        let artifacts = cask_artifacts(&cask)?;
        validate_platform_support(&cask, &artifacts)?;
        if homebrew_metadata_present(&cask.token) {
            bail!(
                "brew-cask:{}: Homebrew owns this cask; remove it with Homebrew before installing it with mise",
                cask.token
            );
        }
        if installed_cask_version(&cask, &artifacts)?.as_deref() == Some(cask.version.as_str()) {
            info!("brew-cask:{}: already installed", cask.token);
            return Ok(cask.version);
        }
        for conflict in &cask.conflicts_with.cask {
            if !installed_versions(conflict).is_empty() {
                bail!(
                    "brew-cask:{}: conflicts with installed cask {}",
                    cask.token,
                    conflict
                );
            }
        }
        if !cask.depends_on.formula.is_empty() {
            let dependencies = cask
                .depends_on
                .formula
                .iter()
                .map(|name| PackageRequest {
                    name: name.clone(),
                    version: None,
                    tap_url: None,
                })
                .collect::<Vec<_>>();
            super::BrewManager::new()

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Uninstall the conflicting cask: `mise uninstall brew-cask:<conflict>` or `brew uninstall --cask <conflict>`, then retry
  2. If you believe the conflict declaration is wrong, check the cask JSON and report it to the tap maintainer

Example fix

# before
$ mise install brew-cask:app-a
error: brew-cask:app-a: conflicts with installed cask app-b

# after
$ mise uninstall brew-cask:app-b
$ mise install brew-cask:app-a
Defensive patterns

Strategy: validation

Validate before calling

// Before install, check the target cask's declared conflicts against the Caskroom:
fn conflicts_installed(conflicts: &[String]) -> Vec<String> {
    conflicts.iter().filter(|c| caskroom_has_versions(c)).cloned().collect()
}
// caskroom_has_versions lists version dirs, ignoring .metadata and .mise-tmp- entries

Try / catch

Catch 'conflicts with installed cask' errors, surface the conflicting token from the message, and offer to uninstall it; do not auto-uninstall without consent.

Prevention

When it happens

Trigger: Installing cask A when a cask B listed in A's conflicts_with.cask array has entries under <Caskroom>/<B> — whether installed by mise or by brew, the check only looks for version directories.

Common situations: GUI tools shipping the same helper or daemon (two VPN clients, two versions of a driver); migrated machines where the old conflicting app is still present.

Related errors


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