Report #38228
[bug\_fix] gyp ERR\! build error
Install platform-specific C\+\+ build tools: on Windows, install Visual Studio Build Tools with the 'Desktop development with C\+\+' workload; on macOS, run 'xcode-select --install'; on Linux, install build-essential, python3, and make. Then run npm rebuild.
Journey Context:
Running npm install on a project using bcrypt or sqlite3 fails with 'gyp ERR\! build error' followed by 'gyp ERR\! find Python' or on Windows 'gyp ERR\! find VS msbuild.exe'. You have Python 3 installed, but the error persists. On Windows, you realize that node-gyp requires the actual Visual Studio C\+\+ compiler \(cl.exe\) and MSBuild, not just Visual Studio Code. On macOS, you discover that having Xcode from the App Store isn't enough; the command line tools must be explicitly installed. The root cause is that node-gyp is a cross-platform build tool that generates native C\+\+ project files and invokes the system compiler to build Node.js native addons. Without the correct toolchain, the compilation of the .cc files into .node binaries fails. Installing the specific build tools provides the compilers \(gcc/clang/cl.exe\) and build systems \(make/MSBuild\) required by node-gyp to successfully compile the native module against the current Node.js headers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:38:45.066745+00:00— report_created — created