I'm working on a yocto project and I'm doing the development on an x86 linux machine. However, the build target is arm64 linux, and I need the native modules (specifically sharp) to be compiled for arm64. However, when I run npm install --target_arch=arm64
, the native modules are only ever for x86. I'm considering using Bun's cross-compilation feature, but I'd really prefer to stick with Node, since it's presumably much more stable.
I tried using export npm_config_arch=arm64
as well as including the --target_arch=arm64
flag for npm. Neither of which installed the arm64 version of sharp.