{"record":{"id":"7cbe56faf2aa4962","repo":"jdx/mise","slug":"provider-does-not-support-adding-packages","errorCode":null,"errorMessage":"provider '{}' does not support adding packages","messagePattern":"provider '(.+?)' does not support adding packages","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/deps/mod.rs","lineNumber":278,"sourceCode":"        self.base().config.depends.clone()\n    }\n\n    /// Timeout duration for this provider's run command\n    fn timeout(&self) -> Option<std::time::Duration> {\n        self.base().config.timeout.as_deref().and_then(|t| {\n            match crate::duration::parse_duration(t) {\n                Ok(d) => Some(d),\n                Err(err) => {\n                    warn!(\"deps: {}: invalid timeout {t:?}: {err}\", self.id());\n                    None\n                }\n            }\n        })\n    }\n\n    /// Command to add one or more package dependencies\n    fn add_command(&self, _packages: &[&str], _dev: bool) -> Result<DepsCommand> {\n        bail!(\"provider '{}' does not support adding packages\", self.id())\n    }\n\n    /// Command to remove one or more package dependencies\n    fn remove_command(&self, _packages: &[&str]) -> Result<DepsCommand> {\n        bail!(\n            \"provider '{}' does not support removing packages\",\n            self.id()\n        )\n    }\n}\n\n/// Warn if any auto-enabled deps providers are stale\npub fn notify_if_stale(config: &Arc<Config>, effective_env: &BTreeMap<String, String>) {\n    // Skip in shims or quiet mode\n    if *env::__MISE_SHIM || Settings::get().quiet {\n        return;\n    }\n","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/deps/mod.rs#L260-L296","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Add the package with the package manager directly (e.g. `cargo add`, `pip install`) and let mise detect the updated manifest","Use a provider that implements add: bun, npm, pnpm, yarn, deno, dart, or aube","For custom providers, implement `add_command` in the provider struct"],"exampleFix":"# before\n$ mise deps add serde --provider cargo   # provider cannot add\n# after\n$ cargo add serde                        # mise picks up Cargo.toml changes","handlingStrategy":"validation","validationCode":"# capability check before mise deps add\nsupports_add() { case \"$1\" in bun|npm|pnpm|yarn|deno|dart|aube) return 0 ;; *) return 1 ;; esac; }\nif supports_add \"$PROVIDER\"; then mise deps add \"$PKG\" --provider \"$PROVIDER\"; else echo \"$PROVIDER cannot add — run its package manager directly\" >&2; fi","typeGuard":"fn supports_add(id: &str) -> bool {\n    matches!(id, \"bun\" | \"npm\" | \"pnpm\" | \"yarn\" | \"deno\" | \"dart\" | \"aube\")\n}","tryCatchPattern":"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.","preventionTips":["Drive adds/removes through the native package manager and let mise track manifests","Script against providers you have verified implement add_command (see src/deps/providers/)","For custom providers, implement add_command/remove_command together or neither"],"tags":["mise","deps","provider","unsupported-operation","packages"],"backgroundTag":"unsupported-operation","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}