Why does my Next.js build fail with a "Bus error (core dumped)" when I push my node_modules folder to my repository?
Date Published: May 8, 2025
The "Bus error (core dumped)" arises from an architecture mismatch. When you install dependencies (using npm install) on a machine with one CPU architecture, such as ARM , and then push the resulting node_modules folder to your repository, that folder contains packages compiled for that specific architecture.
When another machine with a different CPU architecture, such as AMD64/x86_64, that we use for code deployments clones the repository and attempts to build, these pre-compiled binaries within node_modules are incompatible. This incompatibility results in the operating system to generate the "Bus error."
Next.js itself does not provide a more detailed error message in this case because the failure stems from the OS's inability to execute the incompatible native code.
If you must push the node_modules folder to your repository, build your code using an AMD64 architecture machine for compatibility.