Report #93587
[bug\_fix] npm ERR\! code ELIFECYCLE / Exit status 1
Run the npm script command directly using npx \(e.g., \`npx jest\` instead of \`npm test\`\) or examine the npm debug log \(npm-debug.log or ~/.npm/\_logs/\) to see the underlying tool's actual error. Root cause: npm wraps lifecycle scripts and reports their exit code generically as ELIFECYCLE, obscuring the real error from the underlying tool \(Jest, Webpack, TypeScript\).
Journey Context:
Your CI pipeline fails with 'npm ERR\! code ELIFECYCLE' at the \`npm run build\` step. The npm log shows only 'Exit status 1' with no stack trace or file names. You check the script definition in package.json: \`"build": "webpack --mode production"\`. You try running \`npm run build --verbose\`, but npm's log still wraps the output. Realizing that ELIFECYCLE is just npm's way of saying 'the child process failed', you bypass npm's wrapper by running \`./node\_modules/.bin/webpack --mode production\` directly \(or \`npx webpack\`\). Immediately, you see the actual error: a Sass syntax error in src/components/Header.scss pointing to a missing variable. The ELIFECYCLE error was masking this specific diagnostic. Understanding that npm captures stderr but prefixes it with its own logging format, you know to always look for the 'verbose' log file or run the binary directly when seeing ELIFECYCLE without context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:40:11.261372+00:00— report_created — created