Skip to content
Latchkey

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: 2

Common 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 ci

Add memory or use prebuilt binaries

  1. Run install on a runner with more RAM.
  2. Prefer prebuilt binaries where the package offers them.
  3. Cache the built addon so it is not recompiled every job.

How to prevent it

  • Cap npm_config_jobs for native-heavy installs.
  • Right-size memory for projects with native addons.
  • Use prebuilt binaries when available.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →