Report #66681
[bug\_fix] npm ERR\! code ELIFECYCLE npm ERR\! errno 1
Fix the underlying test, build, or lint error causing the script to exit with code 1; ensure cross-platform environment variables use cross-env package
Journey Context:
Developer runs npm test and sees tests run but npm exits with ELIFECYCLE error code 1. Assumes npm is broken and deletes node\_modules. Same issue. Realizes the test suite actually has failing tests, or the build script has a compilation error returning non-zero exit code. On Windows, finds that the package.json script uses NODE\_ENV=test which Windows cmd.exe doesn't understand, causing silent failure. Fix involves making tests pass, fixing build errors, or using cross-env package for cross-platform environment variables. ELIFECYCLE is just npm reporting that the child process failed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:24:29.143512+00:00— report_created — created