ELIFECYCLE npm Origin: Build & delivery Last updated 13 Oct 2026

npm ERR! code ELIFECYCLE / Command failed with exit code 1

An npm script (build, start, test, postinstall) exited with an error. ELIFECYCLE is only the wrapper — the real error is printed above it.

Exact message you may see Command failed with exit code 1Lifecycle scriptnpm ERR! errno 1
Seen on: npm Node.js

Meaning

npm runs the command in package.json scripts and reports ELIFECYCLE / “Lifecycle script failed” when it exits non-zero. Scroll up to the first error from the actual tool (webpack, tsc, jest, node).

Common causes

  • Build/compile error in your code (TypeScript, webpack, Vite)
  • Failing tests
  • Postinstall script of a dependency failing (native modules)
  • Port already in use for npm start
  • Out-of-memory during build (exit code 134/137)

⚡ Quick fix

  1. Scroll up to the first real error above the npm ERR! lines
  2. Run the script command directly to see full output
  3. For memory: NODE_OPTIONS=--max-old-space-size=4096 npm run build
  4. Clean reinstall if a dependency script fails: rm -rf node_modules && npm ci

Detailed fix by platform

npm

  1. Run with verbose logs:
    bash
    npm run build --loglevel verbose
    cat ~/.npm/_logs/*-debug-0.log | tail -50

How to diagnose

  1. First error — What failed before npm ERR!?
  2. Script — Which script and command?
  3. Exit code — 1 = tool error, 134/137 = memory

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

EADDRINUSE — Error: listen EADDRINUSE: address already in use :::3000 (Node.js)EADDRINUSEERR_OSSL_EVP_UNSUPPORTED — Error: error:0308010C:digital envelope routines::unsupported (Node.js)ERR_OSSL_EVP_UNSUPPOR…Gradle wrapper main class — Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain (Java)Gradle wrapper main c…gyp ERR! — gyp ERR! build error / node-gyp rebuild failed (npm)gyp ERR!heap out of memory — FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory (Node.js)heap out of memorylookup registry-1.docker.io: no such host — dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build (Docker)lookup registry-1.doc…Missing script — npm ERR! Missing script: "start" (npm)Missing scriptMSB3027 — error MSB3027: Could not copy "obj\...\App.dll" to "bin\...\App.dll". Exceeded retry count of 10. The file is locked by: "App (1234)" (.NET)MSB3027ELIFECYCLE

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.