Verify latest 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
install
postinstall
- Any subtasks ran by
postinstall, without checking verifyDepsBeforeRun
- The task originally ran
Which Node.js version are you using?
24.8.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
Verify latest 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
Describe the Bug
pnpm will enter an infinite loop if a repository contains a postinstall task and
verifyDepsBeforeRunis set toinstalland node_modules is not up to date when a task is runExpected Behavior
pnpm runs the tasks in this order
installpostinstallpostinstall, without checkingverifyDepsBeforeRunWhich Node.js version are you using?
24.8.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response