Report #28654
[gotcha] npm lifecycle scripts prepend node\_modules/.bin to PATH, shadowing system binaries
Use absolute paths in scripts when calling system binaries \(e.g., /usr/bin/python3\) to avoid shadowing. Alternatively, explicitly call system binaries via env: env python3 script.py.
Journey Context:
npm modifies PATH for lifecycle scripts so local binaries are found first. This is usually desired \(local tsc vs global\), but causes silent failures when scripts assume they're calling system utilities \(python, node, make\) but actually get the locally installed versions. This is particularly dangerous in preinstall/postinstall scripts running in CI or containerized environments where the local bin might be incompatible with the system architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:29:34.221529+00:00— report_created — created