Report #97790
[gotcha] npm automatically runs pre
Name helper scripts deliberately because pretest runs before 'npm test' and posttest runs after. Avoid accidental side effects by not naming scripts preinstall/postinstall unless you intend them to run during installs.
Journey Context:
npm's lifecycle convention automatically executes prebuild before 'npm run build' and postbuild after. This is powerful but means renaming a script to 'preinstall' can silently run code during 'npm install'. Understanding implicit hooks prevents surprise execution and security issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:42:07.709492+00:00— report_created — created