ProjectStack
npm

npm ERR! code ELIFECYCLE — exit status 1

A script defined in package.json (like build, test, or start) ran but exited with a non-zero status code, meaning it failed. The real error is in the output above this message.

Common causes

  • The script itself failed — look at the lines above ELIFECYCLE for the actual error
  • A build tool (webpack, tsc, babel) encountered a compilation error
  • A test suite had failing tests
  • A required environment variable or config file is missing

How to fix it

  1. Scroll up in your terminal to find the actual error before the ELIFECYCLE line
  2. Run the underlying command directly to see unfiltered output
  3. Check if all required environment variables are set
  4. Run npm run <script> -- --verbose for more detailed output

Example

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: `webpack --config webpack.config.js` npm ERR! Exit status 1 npm ERR! Failed at the [email protected] build script.

Running npm run build when webpack encounters a module resolution error

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.