Report #13235
[bug\_fix] npm ERR\! code ELIFECYCLE
Scroll up in the logs to find the actual underlying error \(syntax error, test failure, out of memory\) and fix that root cause. If memory-related, add --max-old-space-size=4096 to NODE\_OPTIONS. Root cause: npm catches the non-zero exit code from a lifecycle script \(test, build, start\) and reports it as ELIFECYCLE, obscuring the actual error.
Journey Context:
Developer runs npm test in a CI pipeline. The build fails with 'npm ERR\! code ELIFECYCLE' and 'npm ERR\! errno 1' at the bottom of a long log. The error message is generic and doesn't indicate what actually broke. Developer initially thinks it's an npm bug. They scroll up through hundreds of lines of output and find 50 lines up there was a 'SyntaxError: Unexpected token' in their test file, or a 'Failing 1 test' from Jest, or 'JavaScript heap out of memory'. They realize ELIFECYCLE is just npm's wrapper around the real exit code. They fix the syntax error, or increase Node memory limit, and the ELIFECYCLE error disappears.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:13:36.186585+00:00— report_created — created