Report #51037
[bug\_fix] gyp ERR\! build error / node-gyp failed to rebuild
Install platform-specific build tools: on macOS run \`xcode-select --install\`; on Ubuntu/Debian \`sudo apt-get install build-essential python3\`; on Windows install Visual Studio Build Tools with "Desktop development with C\+\+" workload. Then ensure \`npm config set python python3\` points to the correct Python executable. Root cause: Native Node.js addons \(C/C\+\+\) must be compiled against the local Node.js headers and V8 version using node-gyp, which requires Python for build scripts and a C\+\+ compiler toolchain.
Journey Context:
Developer clones a repository using \`sharp\` for image processing on a fresh macOS machine. Running \`npm install\` fails during the \`node-gyp rebuild\` phase with \`gyp: No Xcode or CLT version detected\!\` and \`make: command not found\`. The developer realizes that native Node addons require compilation. They install the Xcode Command Line Tools via \`xcode-select --install\`, ensure Python 3 is available, and set \`npm config set python python3\`. Upon retrying, \`node-gyp\` successfully downloads the Node headers, compiles the C\+\+ bindings for \`libvips\` against the local Node.js ABI, and the install completes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:08:53.527073+00:00— report_created — created