Report #95790
[bug\_fix] npm ERR\! code ELIFECYCLE errno 1
Scroll up in the logs to find the actual underlying error \(often a node-gyp compilation failure, test failure, or missing script\); alternatively run npm install --foreground-scripts to see real-time output and identify which lifecycle script is failing.
Journey Context:
Running npm install or npm run build fails with npm ERR\! code ELIFECYCLE npm ERR\! errno 1 with a log file path. Opened the log file and saw the error was at the end of the lifecycle, but the actual cause was buried thousands of lines up in the output where node-gyp failed to compile a native module, or a postinstall script crashed due to missing environment variables. Tried deleting node\_modules and reinstalling but ELIFECYCLE persisted. Realized ELIFECYCLE is just a wrapper error indicating "a lifecycle script exited non-zero". Used npm install --foreground-scripts to see the actual compilation error in real-time instead of buffered in the log. Discovered the real issue was a missing Python dependency for node-gyp. After fixing the underlying cause \(installing build tools\), the ELIFECYCLE error disappeared.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:21:58.835100+00:00— report_created — created