How to fix npm ERR! code ELIFECYCLE npm ERR! errno 137 in npm

npmINTERMEDIATEHIGHUpdated Dec 6, 2025ยท 206 views

Exit code 137 indicates the process was killed by signal 9 (SIGKILL), usually by the OOM killer due to memory exhaustion. Increase available memory or optimize your build process.

Quick fix

Fixes npm ERR! code ELIFECYCLE npm ERR! errno 137

# Check system logs
sudo dmesg | grep -i "killed process"

# Or journalctl
journalctl -k | grep -i oom
  1. Verify OOM kill
  2. Increase Node.js memory
  3. Increase container memory
  4. Reduce parallel operations
npm โ€” error
# Check system logs
sudo dmesg | grep -i "killed process"
# Or journalctl
journalctl -k | grep -i oom
npm ERR! code ELIFECYCLE
npm ERR! errno 137

What this error means

Exit code 137 is calculated as 128 + 9, where 9 is the signal number for SIGKILL. This signal is typically sent by the Linux OOM (Out of Memory) killer when a process consumes too much memory. Unlike other errors where the process chooses to exit, SIGKILL forcefully terminates the process. This commonly occurs during memory-intensive operations like webpack builds, Jest tests, or TypeScript compilation.

Typical symptoms

  • npm script killed with exit code 137
  • Process killed during build
  • Build works locally but fails in CI/CD
  • System becomes slow before error
  • Container restarts unexpectedly
  • dmesg shows OOM killer messages

Common causes

  1. Process exceeded memory limits
  2. OOM killer terminated process
  3. Container memory limit too low
  4. Large bundle size during build
  5. Memory leak in build tool
  6. Too many parallel processes
  7. Insufficient system RAM

How to fix "npm ERR! code ELIFECYCLE npm ERR! errno 137"

1Verify OOM kill

Check if OOM killer was responsible:

bash
# Check system logs
sudo dmesg | grep -i "killed process"

# Or journalctl
journalctl -k | grep -i oom
2Increase Node.js memory

Give Node more heap:

bash
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build

Or in package.json:

json
"build": "node --max-old-space-size=4096 node_modules/.bin/webpack"
3Increase container memory

For Docker/CI:

yaml
# Docker Compose
services:
  build:
    deploy:
      resources:
        limits:
          memory: 4G

# GitHub Actions
jobs:
  build:
    runs-on: ubuntu-latest
    # Consider larger runner
4Reduce parallel operations

Limit concurrency:

bash
# Jest
jest --maxWorkers=2

# Webpack
parallel: false

# npm
npm config set maxsockets 3
5Optimize build process

Reduce memory usage:

javascript
// webpack.config.js
module.exports = {
  optimization: {
    minimize: false // for debugging
  },
  // Use incremental builds
  cache: {
    type: "filesystem"
  }
};
6Split the build

Break into smaller steps:

json
{
  "scripts": {
    "build:js": "webpack --config webpack.js.js",
    "build:css": "webpack --config webpack.css.js",
    "build": "npm run build:js && npm run build:css"
  }
}

Advanced notes

Exit code 137 can also occur from manual SIGKILL or container orchestration killing unresponsive containers. Monitor memory usage during builds with tools like htop or docker stats. In Kubernetes, set appropriate resource requests and limits. Consider using build caching to reduce repeated work. For very large projects, dedicated build machines may be necessary.

Frequently asked questions

What does "npm ERR! code ELIFECYCLE npm ERR! errno 137" mean?
Exit code 137 is calculated as 128 + 9, where 9 is the signal number for SIGKILL. This signal is typically sent by the Linux OOM (Out of Memory) killer when a process consumes too much memory. Unlike other errors where the process chooses to exit, SIGKILL forcefully terminates the process.
How do I fix "npm ERR! code ELIFECYCLE npm ERR! errno 137"?
Exit code 137 indicates the process was killed by signal 9 (SIGKILL), usually by the OOM killer due to memory exhaustion. Increase available memory or optimize your build process.
What causes "npm ERR! code ELIFECYCLE npm ERR! errno 137"?
Process exceeded memory limits OOM killer terminated process Container memory limit too low
Is the "npm ERR! code ELIFECYCLE npm ERR! errno 137" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading