Report #74174
[bug\_fix] ELIFECYCLE exit status 1 or 137 during npm scripts, often with corrupted cache or out-of-memory kills.
Exit 1: \`npm cache clean --force\`, delete \`node\_modules\` and \`package-lock.json\`, then \`npm install\`. Exit 137 \(SIGKILL\): Increase container/system memory or set \`NODE\_OPTIONS=--max-old-space-size=4096\` before the command.
Journey Context:
Your CI pipeline or Docker build fails on \`npm run build\` with \`npm ERR\! code ELIFECYCLE\` and exit status 1. The logs show the script started but died without clear Node stack traces. You check disk space, re-run, same error. You suspect a corrupted package because a colleague can build fine. You try \`npm install\` again, but it uses cached tarballs. You finally run \`npm cache clean --force\`, rm -rf \`node\_modules\` and \`package-lock.json\`, reinstall from scratch, and the build succeeds. Alternatively, on exit 137, you see 'Container killed' or 'Allocation failed' in logs; you realize the build process \(Webpack/Vite\) ran out of RAM in the container, bump the Docker memory limit, and it passes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:05:58.539574+00:00— report_created — created