node-gyp Build Killed (Signal 9) in CI
A native dependency built by node-gyp was killed with signal 9 (SIGKILL). That is the OOM killer terminating the underlying C/C++ compile during npm install on a memory-tight runner.
What this error means
Install fails with gyp ERR! build error and a Killed signal 9 SIGKILL underneath, usually compiling a native addon. A larger runner or lower parallelism clears it with no dependency change.
shell
make: *** [Release/obj.target/addon.o] Killed: 9
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2Common causes
The native compile was OOM-killed
Compiling a native addon spikes memory; on a tight runner the OOM killer sends SIGKILL to the compiler.
Parallel native builds compound the pressure
Several native modules building at once multiply memory use past the runner ceiling.
How to fix it
Reduce build parallelism
Limit make jobs during the native build.
shell
export JOBS=2
npm_config_jobs=2 npm ciAdd memory or use prebuilt binaries
- Run install on a runner with more RAM.
- Prefer prebuilt binaries where the package offers them.
- Cache the built addon so it is not recompiled every job.
How to prevent it
- Cap
npm_config_jobsfor native-heavy installs. - Right-size memory for projects with native addons.
- Use prebuilt binaries when available.
Related guides
CI Step "Killed" Exit Code 137 (OOM)Why CI steps exit with code 137 and "Killed": the OOM killer sent SIGKILL after the job exceeded runner memor…
g++/clang "internal compiler error: Killed" (OOM)Fix "internal compiler error: Killed (program cc1plus)" in CI: the compiler was OOM-killed, not a real ICE. H…
CI "JavaScript heap out of memory" (Node / V8)Fix "JavaScript heap out of memory" in CI when Node/V8 exceeds its heap limit during builds or tests. How to…
CI "Cannot allocate memory" on fork()Fix "fork: Cannot allocate memory" (ENOMEM) in CI when the runner cannot spawn a new process. How to free mem…