Conversation
pnpm v10 setup added PNPM_HOME (not PNPM_HOME/bin) to PATH and wrote a pnpm bootstrap shim there. After upgrading to v11, that shim still points into the old .tools/<version> install, so PATH continues to resolve `pnpm` to the pre-update version even though the new version was installed under global/v11. Detect that layout during self-update, refresh the shims at PNPM_HOME so the upgrade actually takes effect, and warn the user to run `pnpm setup` for a clean migration to the v11 PATH layout. Closes #11464.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR fixes a regression in pnpm v11 where ChangesLegacy v10 Shim Refresh on Self-Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a self-update regression for users who originally installed pnpm with the v10 PNPM_HOME layout. It keeps self-update compatible with that legacy bootstrap location while preserving the v11 PNPM_HOME/bin layout as the current standard.
Changes:
- Detects legacy v10-style shims located directly under
PNPM_HOMEduringpnpm self-update. - Refreshes those legacy shims after installing the new version, and emits a migration hint to run
pnpm setup. - Adds tests covering both legacy-layout refresh and the clean v11 case where no root-level shims should be created.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
engine/pm/commands/src/self-updater/selfUpdate.ts |
Adds legacy shim detection, refresh logic, and a migration warning during self-update. |
engine/pm/commands/test/self-updater/selfUpdate.test.ts |
Adds regression tests for legacy v10 PNPM_HOME shims and verifies clean v11 layouts stay untouched. |
.changeset/self-update-refresh-v10-shim.md |
Documents the self-update fix and its user-visible behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
) pnpm v10 setup added PNPM_HOME (not PNPM_HOME/bin) to PATH and wrote a pnpm bootstrap shim there. After upgrading to v11, that shim still points into the old .tools/<version> install, so PATH continues to resolve `pnpm` to the pre-update version even though the new version was installed under global/v11. Detect that layout during self-update, refresh the shims at PNPM_HOME so the upgrade actually takes effect, and warn the user to run `pnpm setup` for a clean migration to the v11 PATH layout. Closes #11464.
Summary
PNPM_HOMEdirectly to PATH and wrote apnpmbootstrap shim there. v11 setup writes shims underPNPM_HOME/bininstead, so when a v10 user upgrades to v11 the legacy shim atPNPM_HOMEkeeps pointing into the old.tools/<version>install —pnpm --versioncontinues to report the pre-update version even though the new version was installed underglobal/v11.PNPM_HOME/pnpmorPNPM_HOME/pnpm.cmd, which a fresh v11 setup never writes), refreshes those shims so the upgrade actually takes effect for users still on the v10 PATH, and prints a hint suggestingpnpm setupto migrate PATH to the v11 layout.Test plan
pnpmHomeDirgets refreshed;pnpm -vresolved via PATH =pnpmHomeDir(the v10 layout) returns the freshly installed version.pnpmHomeDirwhen no legacy marker is present.selfUpdate.test.tspass.pnpm run lintclean.Summary by CodeRabbit
pnpm self-updatewhen upgrading from v10 installations. The command now detects and refreshes legacy v10 shims, ensuring the new version is properly reflected. Users receive guidance to runpnpm setupfor final migration.