Skip to content

packageManagerDependencies not updated when migrating from legacy packageManager to devEngines.packageManager #11386

@tim-gq

Description

@tim-gq

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

  1. Start with a project using the legacy packageManager field:

    {
      "packageManager": "pnpm@11.0.0-rc.5+sha512.c469fb6..."
    }
  2. The lockfile has:

    packageManagerDependencies:
      pnpm:
        specifier: 11.0.0-rc.5
        version: 11.0.0-rc.5
  3. Migrate to devEngines.packageManager:

    {
      "devEngines": {
        "packageManager": {
          "name": "pnpm",
          "version": "11.0.0"
        }
      }
    }
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions