Visitar URL original
verifyDepsBeforeRun reinstalls before every run when dedupePeers is true and a pnpmfile is active (12.15.0 regression) · Issue #17322 · pnpm/pnpm · GitHub
Skip to content

verifyDepsBeforeRun reinstalls before every run when dedupePeers is true and a pnpmfile is active (12.15.0 regression) #17322

Closed

Description

@christopher-buss

Last pnpm version that worked

12.14.0

pnpm version

12.15.0

Code to reproduce the issue

package.json:

{
  "name": "repro",
  "private": true,
  "packageManager": "pnpm@12.15.0",
  "scripts": { "hello": "node -e 1" },
  "dependencies": { "is-number": "7.0.0" }
}

pnpm-workspace.yaml:

dedupePeers: true

.pnpmfile.cjs:

module.exports = { hooks: { readPackage: (pkg) => pkg } }
pnpm install
printf '\n' >> pnpm-lock.yaml   # any lockfile change, e.g. a git checkout
pnpm hello
pnpm hello
pnpm hello

Expected behavior

The first pnpm hello runs the verifyDepsBeforeRun install once. Later runs see node_modules as up to date and run the script directly, as on 12.14.0.

Actual behavior

Every pnpm run and pnpm exec installs again and warns:

Already up to date
[WARN] The install that ran before the script left node_modules out of date, so the next run installs again. a lockfile setting drifted from the current configuration

The loop stops only after a plain pnpm install. Each later lockfile change starts it again.

With TRACE=pacquet::install=debug:

DEBUG pacquet::install: repeat-install content check: lockfile settings drift, error: `dedupePeers` in the lockfile (true) doesn't match the current config (false)

Additional information

The loop needs all three: dedupePeers: true, an active pnpmfile (local or from a config dependency), and a lockfile changed since the last validation. Without the pnpmfile, or with dedupePeers: false, it does not happen.

The pre-run gate hardcodes dedupe_peers: false in check_deps_status_before_run (pnpm/crates/package-manager/src/optimistic_repeat_install/deps_status.rs), so the lockfile settings comparison always fails when the workspace sets dedupePeers: true. The gate can never record the tree as proven, and the frozen install it starts finds nothing to do. 12.15.0 routes both gates through the shared check_freshness (#17181), which is likely when this comparison started to apply to the run gate.

Passing config.dedupe_peers there, as the install gate does, should fix it.

Node.js version

v26.5.0

Operating System

Windows

Activity

  1. github-actions commented on Oct 24, 2026

    @github-actions
    Contributor

    @christopher-buss, are you planning to open a pull request for this? If so, reply here and a maintainer will assign the issue to you, so nobody else starts on the same fix.

  2. added a commit that references this issue on Oct 25, 2026
    0131bcc
  3. added a commit that references this issue on Nov 3, 2026
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