{"record":{"id":"31dd225946f14e20","repo":"jdx/mise","slug":"name-does-not-support-declarative-package-remova","errorCode":null,"errorMessage":"{name} does not support declarative package removal","messagePattern":"(.+?) does not support declarative package removal","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/system/driver.rs","lineNumber":187,"sourceCode":"        let installed = statuses\n            .iter()\n            .filter(|status| status.request.desired == PackageDesiredState::Present)\n            .filter(|status| status.state.is_installed())\n            .count();\n        if action == Action::Install && installed > 0 {\n            info!(\"{name}: {installed} package(s) already installed\");\n        }\n        let already_absent = statuses\n            .iter()\n            .filter(|status| status.request.desired == PackageDesiredState::Absent)\n            .filter(|status| matches!(status.state, PackageState::Missing))\n            .count();\n        if action == Action::Install && already_absent > 0 {\n            info!(\"{name}: {already_absent} package(s) already absent\");\n        }\n        if !remove_targets.is_empty() {\n            if !mp.manager.supports_remove() {\n                bail!(\"{name} does not support declarative package removal\");\n            }\n            let remove = remove_targets\n                .iter()\n                .map(|status| status.request.clone())\n                .collect::<Vec<_>>();\n            let list = remove\n                .iter()\n                .map(|request| request.to_string())\n                .collect::<Vec<_>>();\n            if !d.dry_run && !d.yes && console::user_attended_stderr() {\n                let msg = format!(\"{name}: remove {}?\", list.join(\", \"));\n                if !prompt::confirm(msg)?.is_yes() {\n                    info!(\"{name}: removal skipped\");\n                } else {\n                    mp.manager.remove(&remove, &opts).await?;\n                    info!(\"{name}: removed {}\", list.join(\", \"));\n                }\n            } else {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/system/driver.rs#L169-L205","documentation":"During `mise system packages install`, the driver computes `remove_targets`: packages whose desired state is `Absent` (declarative removal). If removal targets exist but the manager's `supports_remove()` returns false, the operation cannot honor the declarative spec and mise bails rather than silently leaving packages installed.","triggerScenarios":"A system_packages config (or tracked config files) marks a package as absent (`manager:pkg = false` / absent desired state) while the resolved manager plugin lacks a package-remove hook (`supports_remove() == false`).","commonSituations":"Writing `\"plugin:foo\" = false` for a minimal vfox plugin that only implements install hooks; sharing a config across machines where the plugin variant differs; expecting `system packages install` to uninstall for a manager that only supports install.","solutions":["Implement `hooks/package_uninstall.lua` (or the remove hook) in the plugin so it supports removal.","Remove the absent-marked package entries from the config, or uninstall those packages manually.","Use a different manager that supports removal for those packages.","Run with --dry-run to see which targets would be removed before adjusting config."],"exampleFix":"// before (mise.toml)\n[system_packages]\n\"myplugin:legacy-tool\" = false\n// after: remove the entry and uninstall manually, or switch manager\n[system_packages]\n\"brew:legacy-tool\" = false","handlingStrategy":"validation","validationCode":"# Only mark packages absent for managers that support removal\n# confirm with a dry run listing remove targets\nmise system packages --dry-run","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Implement hooks/package_uninstall.lua in custom plugins before using absent states.","Avoid `manager:pkg = false` entries for minimal install-only plugins.","Use --dry-run to detect remove targets early."],"tags":["cli","system-packages","uninstall","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}