Report #29848
[bug\_fix] gyp ERR\! build error / node-gyp rebuild failed
Install platform-specific build tools: on Windows install windows-build-tools \(Visual Studio Build Tools \+ Python\), on Linux install build-essential and python3, on macOS install Xcode Command Line Tools. Root cause: Native addons contain C\+\+ code that must be compiled against Node.js V8 headers, requiring Python 3.x and a C\+\+ compiler toolchain.
Journey Context:
Developer clones a repository containing native dependencies like bcrypt, sqlite3, sharp, or old node-sass. Running npm install triggers node-gyp rebuild. On a fresh Windows machine, the build fails with "Could not find any Visual Studio installation" or "gyp ERR\! find Python". Developer manually installs Visual Studio Community but gets "MSBuild not found" or version mismatch errors. On macOS, they see "xcode-select: error: tool requires Xcode" or missing stdlibc\+\+ headers. On Linux, "make: not found" or "python: command not found". After extensive searching, they find the official node-gyp installation docs. On Windows, they run npm install --global windows-build-tools \(or manually install Build Tools \+ Python 3\). On macOS, xcode-select --install. On Linux, sudo apt-get install build-essential python3. Once the toolchain is present, node-gyp downloads the correct Node.js headers and compiles the .node binary successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:29:24.519381+00:00— report_created — created