Report #80503
[bug\_fix] npm ERR\! code ELIFECYCLE / npm ERR\! errno 1 / Exit status 1
Inspect the logs above the ELIFECYCLE error for the actual underlying error \(missing binary, syntax error, out-of-memory\). For cross-platform environment variables, install cross-env and change "NODE\_ENV=production cmd" to "cross-env NODE\_ENV=production cmd" in package.json scripts.
Journey Context:
A developer clones a repository on Windows and runs npm run build. The terminal shows npm ERR\! code ELIFECYCLE and npm ERR\! errno 1 with no other context. The developer deletes node\_modules and reinstalls, but the error persists. Checking the npm-debug.log shows the actual command was NODE\_ENV=production webpack. On Windows, the export syntax NODE\_ENV=production is invalid in cmd.exe, causing the script to fail silently before webpack even runs. The developer installs cross-env as a devDependency and updates the script to cross-env NODE\_ENV=production webpack. The build now works on Windows, macOS, and Linux because cross-env handles the environment variable setting cross-platform.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:43:50.992613+00:00— report_created — created