jdx/mise · error

brew-cask: : Homebrew owns this cask; remove it with…

Error message

brew-cask:{}: Homebrew owns this cask; remove it with Homebrew before installing it with mise

What it means

install_one_with_ancestors (src/system/packages/brew/cask.rs:437) checks homebrew_metadata_present(token) before installing: if Homebrew's own receipts/metadata for that cask token exist, Homebrew already owns the artifact tree and mise refuses to touch it, so the two package managers never fight over the same cask.

Solutions

  1. Uninstall it with Homebrew first: brew uninstall --cask <token>, then re-run the mise command
  2. Alternatively keep that cask under Homebrew and remove it from mise's package list so the managers stay separated
  3. If brew already uninstalled the app but receipts remain, delete the leftover token directory under Homebrew's Caskroom and retry

Example fix

# before
$ mise install brew-cask:slack
error: brew-cask:slack: Homebrew owns this cask; remove it with Homebrew before installing it with mise

# after
$ brew uninstall --cask slack
$ mise install brew-cask:slack
Defensive patterns

Strategy: validation

Validate before calling

# before mise-managing a cask, confirm Homebrew does not own it
brew list --cask --versions slack >/dev/null 2>&1 && echo 'brew owns this cask - uninstall first'

Try / catch

On catching the error, shell out to `brew uninstall --cask <token>`, then retry the mise install once.

Prevention

When it happens

Trigger: Running mise install for a cask token that `brew install --cask` previously installed (Homebrew Caskroom metadata present), including casks brew pulled in as dependencies of other packages.

Common situations: Machines that used Homebrew for years before adopting mise; casks installed by brew-based dotfile scripts; partial migrations where some casks were brew-managed and others mise-managed.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/629f8219c9cbdc90. Report an issue: GitHub.

Appendix: source

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

    async fn install_one_with_ancestors(
        &self,
        req: &PackageRequest,
        opts: &InstallOpts,
        pr: Option<&dyn SingleReport>,
        ancestors: &BTreeSet<String>,
        manager_options: &ManagerPackageOptions,
    ) -> Result<String> {
        let cask = fetch_cask(req).await?;
        if ancestors.contains(&cask.token) {
            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
            );
        }
        let installed_version = installed_cask_version(&cask, &artifacts)?;
        if let Some(version) = installed_version.as_ref()
            && (cask.auto_updates || version == &cask.version)
        {
            info!("brew-cask:{}: already installed", cask.token);
            return Ok(version.clone());
        }
        for conflict in &cask.conflicts_with.cask {
            if !installed_versions(conflict).is_empty() {
                bail!(
                    "brew-cask:{}: conflicts with installed cask {}",
                    cask.token,
                    conflict
                );

View on GitHub (pinned to 6f52dcdf99)