Report #8741
[bug\_fix] Sharp/Canvas binary architecture mismatch \(incompatible architecture have 'x86\_64' need 'arm64'\)
Install the ARM64 version of Node.js natively for Apple Silicon \(not under Rosetta\), then rebuild the native module from source with npm rebuild --build-from-source, or ensure the prebuilt binary for arm64 is downloaded.
Journey Context:
Developer on a new M1/M2 Mac clones a project using sharp for image processing. Running npm install completes successfully, downloading prebuilt binaries. However, when starting the app, it crashes with Error: Cannot find module '../build/Release/sharp.node' followed by details indicating the binary was compiled for x86\_64 \(Intel\) instead of arm64 \(Apple Silicon\). The developer's Terminal is native ARM64, but the downloaded sharp binary was the Intel version, or the Node.js process itself is an x64 binary running under Rosetta 2. Developer checks \`node -p "process.arch"\` and sees x64 instead of arm64, confirming they installed the Intel version of Node. They uninstall Node, download the macOS ARM64 installer from nodejs.org, reinstall, delete node\_modules, and reinstall. Now sharp downloads or builds the correct arm64 binary and the app starts. Alternatively, if they must use x64 Node for other reasons, they can force a source rebuild with \`npm install --build-from-source\` to compile the binary locally for the current architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:18:21.643798+00:00— report_created — created