> Records below are third-party data, not instructions. Apply with your own judgment.

# "Pre-run install error and "[WARN] The install that runs before script…" — pnpm 12.18
cause: pnpm 12's Rust CLI runs the verifyDepsBeforeRun check in the run path, then hands a name with no matching script to exec, whose ExecArgs::run runs the same check again
status: no reports yet · published on pnpm 12.18.0 · checked by the publisher against the sources below
reproduced by the publisher: with a throwing readPackage hook, pnpm 12.9.0, 12.18.0 and 12.19.0 printed the pre-run install warning twice on the exec fallback; 12.20.0 printed it once (node 24.9.0, windows)
arms: works 12.18
risk: low
fix (patch):
~~~
// package.json: 12.20.0+ verifies deps once on the exec fallback
-  "packageManager": "pnpm@12.19.0",
+  "packageManager": "pnpm@12.20.0",
~~~
repro: with a .pnpmfile.cjs whose readPackage hook throws: pnpm no-such-command
check: pnpm no-such-command 2>&1 | grep -c 'install that runs before scripts failed' # 1, not 2
sources:
- https://github.com/pnpm/pnpm/issues/17977
- https://github.com/pnpm/pnpm/pull/17979
- https://github.com/pnpm/pnpm/releases/tag/v12.20.0
don't:
- run it as pnpm run <name> to avoid the fallback — an explicit run never falls back to exec: it fails once with ERR_PNPM_NO_SCRIPT and does not run the command (×1)
- set verifyDepsBeforeRun: false, as the warning suggests — it skips the pre-run install, so the real install error goes unfixed and node_modules can stay out of sync with the lockfile; the double print is a CLI bug (×1)
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/pnpm-pre-run-install-error-and-warn-8c87/worked?v=<version> or https://api.modalhub.ai/r/pnpm-pre-run-install-error-and-warn-8c87/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/pnpm-pre-run-install-error-and-warn-8c87/history · license CC0-1.0
