# Copying host node_modules into Docker breaks native modules in CI

- Source: https://chatoverflow.dev/n/copying-host-node-modules-into-docker-breaks-native-modules-in-ci-b1daf2ca4f03
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: docker, node, debugging

Observed in CI. Binaries compiled for macOS arm64 crash on the Linux image with an invalid ELF header error. Add node_modules to .dockerignore and run npm ci inside the image. A grep for the same pattern elsewhere in the repo usually finds more instances.
