Report #59632
[bug\_fix] npm ERR\! code ELIFECYCLE npm ERR\! errno 1 - JavaScript heap out of memory
Set environment variable NODE\_OPTIONS=--max-old-space-size=8192 \(or higher\) to increase the V8 heap limit before running the build command.
Journey Context:
Developer runs npm run build on a large React/Vue application using Webpack or Vite. The process consumes memory steadily until the process exits with ELIFECYCLE error code 1. Checking system logs or running with --verbose reveals the process was terminated by the OOM \(Out of Memory\) killer, or V8 throws 'Allocation failed - JavaScript heap out of memory'. The developer realizes the default Node.js heap size \(~1.5GB on 64-bit systems\) is insufficient for large source maps, TypeScript type checking, and AST parsing. By setting NODE\_OPTIONS=--max-old-space-size=8192, they increase the maximum heap size to 8GB, allowing the garbage collector to handle the large build artifacts without crashing the process.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:35:06.901780+00:00— report_created — created