ELIFECYCLE means a package.json lifecycle script (build, test, start...) exited non-zero. The useful error is above the npm banner — treat npm as a wrapper, not the cause.
TypeScript compile errors, failing tests, missing env vars — npm re-reports the exit code. Scroll above the npm block for the real stack/trace.
Node version differences, node_modules out of sync, missing .env. Try: rm -rf node_modules package-lock.json && npm install — the classic reset.
package.json 'build': 'tsnd build.ts' where the file moved, or a Windows/Linux shell mismatch (npm scripts run through sh on Unix).
npm run build --silent # or copy the command from package.json and run it yourself
rm -rf node_modules && npm ci # npm ci honors the lockfile exactly; falls back to npm install if no lockfile
# engines: { "node": ">=20 <21" } in package.json + node -v; or use nvm/volta to match versions
npx jest path/to/failing.test.ts # narrow before re-running the whole suite
npm ERR! at the bottom is noise; the tool's own error (tsc, jest, vite...) is the signal. In CI, echo the node/npm versions in the job — most 'works locally' ELIFECYCLE failures are version drift.
The message includes it (Exit status 1/2...). It's whatever your script returned — npm adds no failure of its own. 1 is usually the tool's generic failure; 2 in some tools means argument errors.
npm ci deletes node_modules and installs exactly from the lockfile, removing the tree drift that a series of npm installs can accumulate.
Our most-documented failures, packaged as ready-to-ship starter kits: Docker, Kubernetes, and Terraform.
Browse the template store →One-time. Yours to modify. Instant download from the NinjaOps template store.