jdx/mise · error · eyre::Report

brew is not available: {}

Error message

brew is not available: {}

What it means

`mise bootstrap packages prune --manager brew` needs the Homebrew CLI. `brew::BrewManager::is_available()` (which locates the `brew` executable) returned false, so run_brew bails with the reason from `unavailable_reason()` — typically that `brew` is not installed or not found on PATH.

Source

Thrown at src/cli/system/prune.rs:61

        {
            bail!(
                "manager '{}' is excluded by the system_packages.managers setting",
                self.manager
            );
        }
        match self.manager.as_str() {
            "brew" => self.run_brew().await,
            "brew-cask" => self.run_brew_cask().await,
            _ => unreachable!(),
        }
    }

    #[cfg(unix)]
    async fn run_brew(self) -> Result<()> {
        debug_assert_eq!(self.manager, "brew");
        let manager = brew::BrewManager::new();
        if !manager.is_available() {
            bail!("brew is not available: {}", manager.unavailable_reason());
        }
        let config = Config::get().await?;
        let configured = system::packages_from_config_and_tracked_config_files(&config)
            .await?
            .into_iter()
            .find(|mp| mp.manager.name() == "brew")
            .map(|mp| mp.requests)
            .unwrap_or_default();
        let plan = brew::prune_plan(&configured).await?;
        if plan.is_empty() {
            info!("brew: nothing to prune");
            return Ok(());
        }
        if self.dry_run {
            brew::apply_prune_plan(&plan, true)?;
            return Ok(());
        }
        let remove = plan

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Confirm with `command -v brew` in the same shell mise runs from — if empty, install Homebrew (macOS: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")
  2. If brew is installed but not found, add its bin dir to PATH (eval "$(brew shellenv)") in the shell profile or set MISE_ENV_PATH/PATH accordingly
  3. On Linux, install Linuxbrew or prune with a manager that exists on the host

Example fix

# before
$ mise bootstrap packages prune --manager brew
# error: brew is not available: ...

# after
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ eval "$(brew shellenv)"
$ mise bootstrap packages prune --manager brew
Defensive patterns

Strategy: validation

Validate before calling

if ! command -v brew >/dev/null 2>&1; then
  echo "skip: brew not installed" >&2
  exit 0
fi
mise bootstrap packages prune --manager brew

Try / catch

mise bootstrap packages prune --manager brew || { echo "brew unavailable — install Homebrew or fix PATH (eval \"$(brew shellenv)\")" >&2; exit 1; }

Prevention

When it happens

Trigger: Pruning with `--manager brew` on a host without Homebrew installed, or where the brew binary directory (e.g. /home/linuxbrew/.linuxbrew/bin or /opt/homebrew/bin) is missing from the PATH that mise inherits.

Common situations: Fresh CI container without brew; running mise from a non-login shell or GUI-launched process whose PATH omits the brew prefix; Linux machine where only linuxbrew would provide brew and it was never installed.

Related errors


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