fix(arborist): reject uninstall args that carry a version (#9881)
## What / Why `npm uninstall vite@8.2.1` neither removes the package nor complains about the argument. The spec goes straight through to Arborist as an `rm` entry, nothing in the tree is named `vite@8.2.1`, so the reify finishes with "up to date" and `npm ls` still shows `vite`. `npm update` already validates its own argument list and throws `EUPDATEARGS` for anything that is not a bare package name. This applies the same rule to `rm`, so a version, tag or range now fails with `ERMARGS` and the message names the command to run instead. ## Testing New case in `workspaces/arborist/test/arborist/build-ideal-tree.js`, next to the existing rm test and mirroring the update one. It covers an exact version, a tag, ranges, a scoped name carrying a version, and a filesystem path, where the suggestion falls back to `<pkg>` because there is no name to print. It fails without the change. ## References Fixes #9880
L
Lazizbek Ergashev committed
da50c3479b556da74f88ff0b579d5191a7db0a24
Parent: 71915e8
Committed by GitHub <noreply@github.com>
on 8/25/2026, 6:28:37 PM