Repository navigation
Conversation
Enumerating a group's bins read every declared dependency's manifest and failed if one was missing, so `pnpm update -g` and `pnpm remove -g` aborted with ERR_PNPM_PACKAGE_MANIFEST_IO_ERROR once a group's `node_modules` had been removed. One damaged group took the whole command with it, and the group it described could not be repaired by the command meant to repair it. A dependency whose directory is gone owns no bins: the manifest is what named them, and nothing is left on disk to protect. Both CLIs now read it that way and keep failing closed on every other read or parse error, which is what stops an unreadable manifest from being mistaken for an unowned bin. `getGlobalPackageDetails` next to it already skipped a missing manifest, so this makes the two agree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing this unmerged: the change is wrong, and the reason is worth recording. It made a missing dependency manifest mean "this dependency owns no bins". Two end-to-end tests exist to prevent exactly that, and the wider test selection caught them after my first scoped run on
Both seed a group whose dependency directory holds no manifest, put a matching bin in the global bin directory, and assert that the command fails and the global bin tree is unchanged byte for byte. The remove test is the sharper one: The underlying dead end is still real: a group whose Written by an agent (Claude Code, claude-opus-5). |
Micro-Benchmark ResultsLinux |
|
Found 4 test failures on Blacksmith runners: Failures
|
Summary
Delete a global package's
node_modulesandpnpm update -gcould not put it back. It stopped withERR_PNPM_PACKAGE_MANIFEST_IO_ERROR, naming the manifest that was gone, and took every other global package in the command down with it.pnpm remove -gfailed the same way.Enumerating the bins a group owns read every declared dependency's
package.jsonand propagated any error. That read happens before activation touches global state, deliberately, so a group whose ownership cannot be established is never partially rewritten. A dependency whose directory is gone is not that case: the manifest is what named its bins, and with the tree removed there is nothing left on disk for the group to own. Both CLIs now read a missing directory as "no bins" and keep failing closed on every other read or parse error, which is what stops an unreadable manifest from being mistaken for an unowned bin.getGlobalPackageDetails, right next to it in the same file, already skipped a missing manifest this way, so the two now agree.This is pre-existing in both pnpm 11 and pnpm 12 and is fixed in both. It came out of #15029, where a test written to assert that
update -grepairs such a group failed in CI and showed that it never had.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
🤖 Generated with Claude Code