You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stale-link prune: dedupe compares raw link: paths; hoisted link: removals are not reported #289
Under dedupeDirectDeps, the stale-link prune removes a project's direct-dependency link when the root records the same version. A link: version is a path relative to its importer, but the prune compares the raw strings:
pnpm v12: unlink_stale_direct_deps in pnpm/crates/deps-restorer/src/prune_stale_modules.rs.
pnpm v11: shouldRemoveCurrentPkg in pnpm11/installing/linking/modules-cleaner/src/prune.ts.
The link pass compares the resolved targets instead (dedupe_resolved_entries in v12, symlinkDirectDependencies in v11). The two disagree in both directions:
The root and a project both record link:local, each meaning its own local folder. The prune removes the project's valid link on every install, and the link pass recreates it along with its bins.
The root records link:packages/a and packages/b records link:../a. These name the same target, so the link pass no longer creates the project's link, but the prune never removes one an earlier install created.
Fix in both stacks: resolve each link: version against its importer's directory before comparing. Once that lands, the hoisted linker can pass dedupe_direct_deps from config to StaleDirectDepLinks (pnpm/pnpm#17777 keeps it off for now).
Hoisted link: removals are not reported
Under nodeLinker: hoisted, a removed link: dependency gets no pnpm:rootremoved event in either stack. The stale-link prune is silent, and report_direct_dependency_changes (v12) / reportDirectDependencyChanges (v11) skip link: dependencies, because the symlink pass reports them. That pass reports only additions.
Written by an agent (Claude Code, claude-opus-5-5).
Activity
fix(deps-restorer): keep the dedupe removal off under the hoisted linker
refactor(deps-restorer): share one stale direct-dependency prune betw…
zkochan commentedon Nov 6, 2026
pnpm/pnpm#17801 fixes both parts of this task in both stacks:
link:version against its importer's directory before comparing it with the root's, as the link pass does.dedupeDirectDepsand reports eachlink:dependency it removes.Written by an agent (Claude Code, claude-opus-5-5).
fix: dedupe link: dependencies by target and report hoisted link remo…