Description
When migrating from the legacy packageManager field to devEngines.packageManager, pnpm does not update or regenerate the packageManagerDependencies section in pnpm-lock.yaml.
Steps to Reproduce
-
Start with a project using the legacy packageManager field:
{
"packageManager": "pnpm@11.0.0-rc.5+sha512.c469fb6..."
}
-
The lockfile has:
packageManagerDependencies:
pnpm:
specifier: 11.0.0-rc.5
version: 11.0.0-rc.5
-
Migrate to devEngines.packageManager:
{
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "11.0.0"
}
}
}
-
Run pnpm install
Expected Behavior
The packageManagerDependencies section should be updated to reflect the new version:
packageManagerDependencies:
pnpm:
specifier: 11.0.0
version: 11.0.0
Actual Behavior
The packageManagerDependencies section remains unchanged with the old version (11.0.0-rc.5), even after running:
pnpm install
pnpm install --fix-lockfile
pnpm install --force
pnpm install --lockfile-only
The only workaround is to manually edit the lockfile.
Environment
- pnpm version: 11.0.0
- Node.js version: 24.x
- OS: macOS
Related
This appears related to PR #11284 which mentions that devEngines.packageManager "populates and reuses" the section — the "reuses" behavior seems to prevent updates when the source field changes.
Description
When migrating from the legacy
packageManagerfield todevEngines.packageManager, pnpm does not update or regenerate thepackageManagerDependenciessection inpnpm-lock.yaml.Steps to Reproduce
Start with a project using the legacy
packageManagerfield:{ "packageManager": "pnpm@11.0.0-rc.5+sha512.c469fb6..." }The lockfile has:
Migrate to
devEngines.packageManager:{ "devEngines": { "packageManager": { "name": "pnpm", "version": "11.0.0" } } }Run
pnpm installExpected Behavior
The
packageManagerDependenciessection should be updated to reflect the new version:Actual Behavior
The
packageManagerDependenciessection remains unchanged with the old version (11.0.0-rc.5), even after running:pnpm installpnpm install --fix-lockfilepnpm install --forcepnpm install --lockfile-onlyThe only workaround is to manually edit the lockfile.
Environment
Related
This appears related to PR #11284 which mentions that
devEngines.packageManager"populates and reuses" the section — the "reuses" behavior seems to prevent updates when the source field changes.