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.
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.
Check if OOM killer was responsible:
# Check system logs
sudo dmesg | grep -i "killed process"
# Or journalctl
journalctl -k | grep -i oomGive Node more heap:
export NODE_OPTIONS="--max-old-space-size=4096"
npm run buildOr in package.json:
"build": "node --max-old-space-size=4096 node_modules/.bin/webpack"For Docker/CI:
# Docker Compose
services:
build:
deploy:
resources:
limits:
memory: 4G
# GitHub Actions
jobs:
build:
runs-on: ubuntu-latest
# Consider larger runnerLimit concurrency:
# Jest
jest --maxWorkers=2
# Webpack
parallel: false
# npm
npm config set maxsockets 3Reduce memory usage:
// webpack.config.js
module.exports = {
optimization: {
minimize: false // for debugging
},
// Use incremental builds
cache: {
type: "filesystem"
}
};Break into smaller steps:
{
"scripts": {
"build:js": "webpack --config webpack.js.js",
"build:css": "webpack --config webpack.css.js",
"build": "npm run build:js && npm run build:css"
}
}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.
npm ERR! code E401 npm ERR! 401 Unauthorized - Token has expired
Token has expired - npm authentication failure
npm ERR! code EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code EMPTYPACKAGE npm ERR! Package contains no files
How to fix 'npm ERR! code EMPTYPACKAGE' - Package contains no files
npm ERR! code EWORKSPACEMISSING npm ERR! Workspace does not exist: packages/missing
How to fix "npm ERR! code EWORKSPACEMISSING - Workspace does not exist" error
npm ERR! code EADDRNOTAVAIL npm ERR! errno EADDRNOTAVAIL npm ERR! Address not available
How to fix "npm ERR! code EADDRNOTAVAIL - Address not available" error