Skip to content

infinite loop with a postinstall task and verifyDepsBeforeRun: install #10060

@sadan4

Description

@sadan4

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

10.15.1

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

CLI

Link to the code that reproduces this issue or a replay of the bug

https://github.com/sadan4/pnpm-postinstall-loop

Reproduction steps

git clone https://github.com/sadan4/pnpm-postinstall-loop
cd pnpm-postinstall-loop
pnpm foo
# observe infinite loop

Describe the Bug

pnpm will enter an infinite loop if a repository contains a postinstall task and verifyDepsBeforeRun is set to install and node_modules is not up to date when a task is run

Expected Behavior

pnpm runs the tasks in this order

  1. install
  2. postinstall
  3. Any subtasks ran by postinstall, without checking verifyDepsBeforeRun
  4. The task originally ran

Which Node.js version are you using?

24.8.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions