jdx/mise · error

mise is installed via a package manager, cannot update

Error message

mise is installed via a package manager, cannot update

What it means

`mise self-update` replaces the mise binary in place, which only works when mise owns its install location. When mise detects it was installed by a package manager (brew, apt, cargo, npm, etc.), it refuses to self-update to avoid corrupting the package-managed install. Unless --force is passed, it prints upgrade instructions and bails.

Solutions

  1. Update through the original package manager (brew upgrade mise, apt upgrade, cargo install mise, etc.)
  2. Reinstall via the official install script or curl method to get a self-updatable binary
  3. Use `mise self-update --force` only if you understand the binary is not package-managed

Example fix

// before
mise self-update   # error: installed via package manager
// after
brew upgrade mise   # or the package manager that installed mise
Defensive patterns

Strategy: fallback

Validate before calling

mise self-update --dry-run 2>/dev/null || upgrade_via_package_manager

Try / catch

if ! mise self-update 2>&1 | grep -q 'package manager'; then brew upgrade mise; fi

Prevention

When it happens

Trigger: Running `mise self-update` (directly or via maybe_auto_update) when `Self::is_available()` returns false because the executable path resolves to a package-manager-managed location.

Common situations: mise installed via Homebrew, APT, pacman, npm, or cargo; CI images with distro-packaged mise; users upgrading a brew install with mise instead of `brew upgrade mise`.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/bc2cb7ac5e54ff97. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/self_update.rs:423

/// when the child exits non-zero; a child that never starts comes back as the bare OS error, so an
/// `ACCESS_DENIED` from spawning the freshly written binary arrives as nothing but
/// "Access is denied. (os error 5)".
///
/// Takes the binary to run rather than reading [`env::MISE_BIN`] itself, so a test can drive the
/// failure without a real update.
fn update_plugins(bin: &std::path::Path) {
    if let Err(err) = cmd!(bin, "plugins", "update").run() {
        warn!("Failed to update plugins: {err}");
    }
}

impl SelfUpdate {
    pub(crate) async fn run(self) -> Result<()> {
        if !Self::is_available() && !self.force {
            if let Some(instructions) = upgrade_instructions_text() {
                warn!("{}", instructions);
            }
            bail!("mise is installed via a package manager, cannot update");
        }
        // Before the update, not after: this run is about to create a copy of its own, and that one
        // is in use rather than stale. Before the length check too, and that ordering is the whole
        // point: a `TEMP` long enough to refuse the update is the case the leftovers come from, so
        // running the sweep afterwards means the only machines that accumulate them are the only
        // machines that never reach the code that collects them.
        #[cfg(windows)]
        sweep_helper_orphans();
        #[cfg(windows)]
        Self::ensure_temp_dir_can_replace_binary()?;
        let status = self.do_update()?;

        if status.is_updated() {
            let version = status.version().to_string();
            let styled_version = style(&version).bright().yellow();
            miseprintln!("Updated mise to {styled_version}");
            // On Windows, "exe"/"hardlink" shims are copies of mise-shim.exe and
            // go stale after an update. Refresh mise-shim.exe, and ONLY if that

View on GitHub (pinned to 533346cc37)