Files
pnpm/pkg-manager
Zoltan Kochan 00e7787097 feat: allow global install to override bins owned by the new package (#10828)
* feat: allow global install to override bins owned by the new package

When a package name matches the bin name (e.g., `npm` package providing
`npm` bin), the new package gets priority and can override an existing
bin from another global package. The `npx` bin is also treated as owned
by the `npm` package via a hardcoded override map.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: run benchmarks on node.js 25

* feat: skip linking bins owned by existing global packages instead of failing

When installing a package globally (e.g. node) whose bins conflict with
an already-installed package that owns those bins (e.g. npm owns npm/npx),
the install now succeeds and skips linking the conflicting bins rather
than aborting with GLOBAL_BIN_CONFLICT.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: improve global bin conflict checks for aliased packages and multi-provider bins

Track all new bin providers (not just the last one) so ownership is
correctly resolved when multiple new packages provide the same bin.
Use manifest.name instead of the dependency alias when checking
existing package ownership, fixing incorrect decisions for aliased
installs. Use symlink-dir in tests for Windows compatibility and
remove a non-null assertion in link-bins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use Set for conflicting bins lookup and fix error hint to use alias

Convert the conflicting bins collection from an array to a Set for O(1)
lookups. Use the dependency alias in the `pnpm remove -g` hint since
that is what the user originally installed with, showing both alias and
manifest name when they differ.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove changeset

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 15:42:04 +01:00
..
2026-02-18 14:54:09 +01:00
2026-02-18 14:54:09 +01:00