Report #17793
[bug\_fix] npm ERR\! code ELIFECYCLE npm ERR\! errno 1
Check the actual script error output above the ELIFECYCLE line in logs; fix the underlying command failure \(test assertion, build syntax error, missing env var\). Root cause: npm wraps lifecycle scripts in error handler; when underlying command \(jest, webpack, tsc\) exits non-zero, npm reports ELIFECYCLE as wrapper error code.
Journey Context:
Developer runs npm test. Sees 'npm ERR\! code ELIFECYCLE' at bottom of long red output. Panics, googles ELIFECYCLE. Tries deleting node\_modules. Reinstalls. Same error. Looks closer at output above ELIFECYCLE lines. Sees 'FAIL src/App.test.js' and 'ReferenceError: expect is not defined'. Realizes Jest config is broken or missing import. Fixes the actual test error. ELIFECYCLE disappears. Learns ELIFECYCLE is just npm saying 'the script failed' not the actual error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:22:34.904718+00:00— report_created — created