Report #98656
[bug\_fix] node-gyp ERR\! build error — native addon compilation fails
Install the platform build toolchain, then clean and reinstall. On macOS: \`xcode-select --install\`. On Windows: install "Desktop development with C\+\+" via Visual Studio Build Tools or \`npm install --global windows-build-tools\` on older setups. On Debian/Ubuntu: \`sudo apt-get install build-essential python3 make\`. Then \`npm rebuild\` or delete \`node\_modules\` and reinstall. The root cause is that the npm package contains C/C\+\+ bindings that must be compiled against the current Node ABI and V8 headers.
Journey Context:
You clone a repo and run \`npm install\`. A package like \`bcrypt\`, \`sharp\`, or \`sqlite3\` starts compiling and dies with \`node-gyp ERR\! build error\`. The log mentions missing \`gyp\`, \`make\`, or \`python3\`. You search the error and land on the node-gyp README. You realize Node native addons need a compiler toolchain, not just Node. After installing the OS-specific build tools you run \`npm rebuild\` so the compiled binaries match your exact Node version. The install completes and the native module loads.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:33:26.302860+00:00— report_created — created