jdx/mise · error · eyre::Report

provider '{}' does not support adding packages

Error message

provider '{}' does not support adding packages

What it means

Default implementation of the `DepsProvider::add_command` trait method (src/deps/mod.rs:277). Only providers that can drive their package manager's add workflow override it (bun, npm, deno, pnpm, dart, aube, yarn — see src/deps/providers/); every other provider inherits this bail. `mise deps add` (src/cli/deps/add.rs:67) calls it, so adding through an unsupported provider is a hard error, not a no-op.

Source

Thrown at src/deps/mod.rs:278

        self.base().config.depends.clone()
    }

    /// Timeout duration for this provider's run command
    fn timeout(&self) -> Option<std::time::Duration> {
        self.base().config.timeout.as_deref().and_then(|t| {
            match crate::duration::parse_duration(t) {
                Ok(d) => Some(d),
                Err(err) => {
                    warn!("deps: {}: invalid timeout {t:?}: {err}", self.id());
                    None
                }
            }
        })
    }

    /// Command to add one or more package dependencies
    fn add_command(&self, _packages: &[&str], _dev: bool) -> Result<DepsCommand> {
        bail!("provider '{}' does not support adding packages", self.id())
    }

    /// Command to remove one or more package dependencies
    fn remove_command(&self, _packages: &[&str]) -> Result<DepsCommand> {
        bail!(
            "provider '{}' does not support removing packages",
            self.id()
        )
    }
}

/// Warn if any auto-enabled deps providers are stale
pub fn notify_if_stale(config: &Arc<Config>, effective_env: &BTreeMap<String, String>) {
    // Skip in shims or quiet mode
    if *env::__MISE_SHIM || Settings::get().quiet {
        return;
    }

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Add the package with the package manager directly (e.g. `cargo add`, `pip install`) and let mise detect the updated manifest
  2. Use a provider that implements add: bun, npm, pnpm, yarn, deno, dart, or aube
  3. For custom providers, implement `add_command` in the provider struct

Example fix

# before
$ mise deps add serde --provider cargo   # provider cannot add
# after
$ cargo add serde                        # mise picks up Cargo.toml changes
Defensive patterns

Strategy: validation

Validate before calling

# capability check before mise deps add
supports_add() { case "$1" in bun|npm|pnpm|yarn|deno|dart|aube) return 0 ;; *) return 1 ;; esac; }
if supports_add "$PROVIDER"; then mise deps add "$PKG" --provider "$PROVIDER"; else echo "$PROVIDER cannot add — run its package manager directly" >&2; fi

Type guard

fn supports_add(id: &str) -> bool {
    matches!(id, "bun" | "npm" | "pnpm" | "yarn" | "deno" | "dart" | "aube")
}

Try / catch

Call provider.add_command(...) via the trait and match the error; if the message starts with `provider '...' does not support adding packages`, fall back to printing the manual command for that package manager instead of failing the whole run.

Prevention

When it happens

Trigger: `mise deps add <pkg> --provider <id>` (or API equivalent) where `<id>` is a provider that did not override `add_command` — a manifest-tracking-only provider with no add workflow.

Common situations: Trying `mise deps add` with providers like cargo/pip that mise tracks but cannot drive; CI scripts assuming all enabled providers support add; custom in-house providers written without the override.

Related errors


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