Skip to content

pnpm install and non-install commands disagree on @pnpm/exe in packageManagerDependencies, lockfile flip-flops forever #14575

Description

@ruchernchong

Verify latest release

  • I verified that the issue exists in the latest pnpm release (12.3.4)

pnpm version

12.3.4

Which area(s) of pnpm are affected? (leave empty if unsure)

Lockfile, CLI

Reproduction steps

Minimal project, no dependencies — only the pin (devEngines or packageManager, both reproduce):

{
  "name": "pnpm-exe-repro",
  "private": true,
  "devEngines": {
    "packageManager": { "name": "pnpm", "version": "12.3.4", "onFail": "download" }
  }
}
$ pnpm i --lockfile-only
$ grep -c "@pnpm/exe@" pnpm-lock.yaml
0
$ pnpm list
$ grep -c "@pnpm/exe@" pnpm-lock.yaml
2
$ pnpm i --lockfile-only
$ git diff --stat pnpm-lock.yaml
# empty — byte-identical to the first install

The block added by pnpm list (+19 lines): an '@pnpm/exe' entry under packageManagerDependencies, plus the @pnpm/exe@12.3.4 entries under packages: and snapshots:. Reproduces with pnpm exec … too, and with "packageManager": "pnpm@12.3.4" instead of devEngines.

Describe the Bug

The install pipeline and the pre-command syncEnvLockfile path disagree on the content of the env document: install records only pnpm, while any non-install command (list, exec, …) additionally records the running executable as @pnpm/exe. Alternating the two commands flips the same 19 lines back and forth indefinitely, so the lockfile is never stable and every other command dirties the tree.

Expected Behavior

Both paths converge on one representation — either both record @pnpm/exe or neither does — so a read-only command like pnpm list never dirties pnpm-lock.yaml after an up-to-date install.

Related

Which Node.js version are you using?

v26.1.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions