fix(arborist): drop orphaned patch entry on uninstall instead of EPATCHUNUSED (#9574)
`npm uninstall <pkg>` failed with `EPATCHUNUSED` when the package had a registered patch, because uninstall left the now-orphaned `patchedDependencies` entry in `package.json`. This also wedged the project: every subsequent `npm install` failed the same way until the user manually ran `npm patch rm`. `resolvePatchedDependencies` now receives the `rm` list from `buildIdealTree` and drops an unused selector whose package is being removed, and `reify` persists that removal to `package.json`. Selectors unused for any other reason still throw `EPATCHUNUSED`, and a package that survives as a transitive dependency keeps its patch. ## References <!-- List any relevant issues, pull requests, or external references --> Fixes #9572
M
Manzoor Wani committed
315e3bd7c8ece0e118131c423deb6c8240695089
Parent: a847d28
Committed by GitHub <noreply@github.com>
on 6/18/2026, 9:08:34 PM