Guides
Fixing Node native modules on arm64
npm install fails or compiles from source on arm64 runners.
5 min read
npm install fails or compiles from source on arm64 runners.
Why it happens
The package has no prebuilt aarch64 binary, so node-gyp builds it locally.
How to fix it
- Check whether a newer version ships aarch64 prebuilds
- Cache the node-gyp build output so the compile happens once
- Install build-essential and python3 so the fallback compile can succeed
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to move CI to arm64 runnersYou deploy to Graviton or Ampere but build on x64.arm64 migration checklistYou want to move to arm64 without breaking the pipeline.Cross-compiling versus native arm64You need arm64 binaries and are unsure whether to cross-compile or build natively.Why QEMU arm64 builds are so slowAdding linux/arm64 to a Docker build makes it twenty times slower.