Skip to content

Problem different build and prod environments

Eugene Lazutkin edited this page Mar 24, 2026 · 1 revision

node-gyp compiles for the current platform. Copying the result to a different environment can cause ABI mismatches or other problems — for example, different CPU instruction sets between build and production machines.

The most common case is Docker: an image built on a developer's Mac may run on a Linux VM in AWS with a different CPU.

Make sure your build and execution environments match. Ideally, run npm ci inside the target environment (e.g., during Docker image execution, not during image build).

Relevant links:

Clone this wiki locally