Report #35243
[bug\_fix] npm ERR\! code ELIFECYCLE / npm ERR\! errno 1
Run the failing script directly with npx or ./node\_modules/.bin/ to see the actual error, or run npm run script --verbose. Root cause: npm suppresses stderr/stdout of lifecycle scripts on failure; the real error \(TypeScript compilation, test failure, missing env var\) is hidden.
Journey Context:
Developer runs npm run build in a CI pipeline. It fails instantly with ELIFECYCLE errno 1 and a vague log showing the script exited. They try running npm run build locally and it works, suggesting an environment difference. They re-run with npm run build --verbose and see that in CI, a TypeScript compiler error is actually being emitted but npm's default loglevel was hiding it. Alternatively, they run ./node\_modules/.bin/tsc directly and see the actual error: a missing DATABASE\_URL environment variable required by a config file loaded during the build. The fix is either fixing the underlying script error \(the TypeScript bug or missing env\) or ensuring npm shows full output via --foreground-scripts or --verbose.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:37:52.173822+00:00— report_created — created