# pnpm / npm: “ELIFECYCLE Command failed with exit code 1”

> ELIFECYCLE Command failed with exit code 1 (pnpm) or npm ERR! code ELIFECYCLE (npm 6). The script itself failed; the real error is printed just above.

Canonical: https://app369.com/fix/npm-elifecycle/
Last updated: 2026-11-08

npm run build, npm start or npm install ends with ELIFECYCLE Command failed with exit code 1 (pnpm and Yarn) or npm ERR! code ELIFECYCLE and errno 1 (npm 6). npm 7 and newer print no ELIFECYCLE line: you see the script’s own output, then npm error command failed, or Lifecycle script `build` failed with error in workspaces. This is not the error. It is npm reporting that the command in package.json scripts exited with a non-zero code. The actual cause is in the output just above it.

**Short answer**

Scroll up past the npm lines to the first error the script printed and fix that: a compile error, a failing test, a missing module. The exit code helps: 1 is a normal failure, 127 means the command was not found (run npm install, or the package that provides it is missing), and 137 means the process was killed, most often for running out of memory. During npm install, the failing script belongs to a dependency, so the package name in the message is the one to look at.

## **What the exit code tells you, and the fix**

1. 01 ### **Exit code 1: the script reported an error**
  > “If the script exits with a code other than 0, then this will abort the process.” [**npm Docs, Scripts: exiting**](https://docs.npmjs.com/cli/v11/using-npm/scripts) The build tool, test runner or server failed and printed why before npm took over. Run the script directly to see its output without npm’s summary around it.```
# what does the script run?
npm pkg get scripts.build
# run the same command to see its own error
npx vite build
```
2. 02 ### **Exit code 127: command not found** Messages such as sh: react-scripts: command not found or vite: not found mean the tool is not installed in node_modules/.bin. Install dependencies, and check that the tool is listed in package.json (in CI, make sure devDependencies are installed too).```
npm ci
npm ls vite
```
3. 03 ### **Exit code 137 or SIGKILL: out of memory** The process was killed (some tools print killed with SIGKILL), most often by the operating system or container for using too much memory during a build. A CI timeout or a manual kill gives the same code. Give the build more memory or reduce what runs in parallel.
4. 04 ### **A dependency’s install script failed** During npm install, packages run their own preinstall, install and postinstall scripts, often to compile native code. The message names the package and the script. Upgrade that package, install its build tools, or check its issue tracker for your Node.js version.

Checked against the vendor’s docs on November 8, 2026: [npm Docs: scripts](https://docs.npmjs.com/cli/v11/using-npm/scripts).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

Related: [**Vercel “npm run build exited with 1”**](https://app369.com/fix/vercel-npm-run-build-exited-with-1/) · [**Node.js “JavaScript heap out of memory”**](https://app369.com/fix/javascript-heap-out-of-memory/) · [**npm “EPERM: operation not permitted”**](https://app369.com/fix/npm-eperm-operation-not-permitted/)

Questions

## **More on this error**

<details>

<summary>**Will deleting node_modules and package-lock.json fix it? **+</summary>

Only when the install itself is broken. Deleting the lockfile also upgrades every dependency within its ranges, which can add new failures. Read the real error first; if you reinstall, keep the lockfile and use npm ci.

</details>

<details>

<summary>**Why does it fail in CI but work on my machine? **+</summary>

Usually a different Node.js version, missing environment variables the build reads, or devDependencies not installed. Print node -v in CI and compare it with your machine.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)