Report #9102
[bug\_fix] Error: Cannot find module '../build/Release/binding.node'
Run npm rebuild or npm install after installing platform build tools \(Python 3, C\+\+ compiler, make/Visual Studio Build Tools\). Root cause: Native Node addons \(sharp, bcrypt, sqlite3\) compile C\+\+ against Node's ABI; the .node binary is either missing, compiled for the wrong architecture \(ARM vs x64\), or compiled against a different Node version \(ABI mismatch\).
Journey Context:
A developer clones a repository on a new M1 Mac and runs npm install, which completes without errors. However, running the application crashes immediately with 'Error: Cannot find module '../build/Release/sharp.node''. Inspecting node\_modules/sharp reveals the build/Release directory is missing entirely. The developer realizes sharp requires native compilation for the ARM architecture. They install Xcode Command Line Tools and Python 3, then run npm rebuild sharp --verbose. The build compiles the C\+\+ bindings against the current Node.js ABI, generating the missing .node file. The app starts successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:17:38.274769+00:00— report_created — created