Report #61351
[bug\_fix] gyp ERR\! stack Error: \`gyp\` failed with exit code: 1
Install platform build tools: Windows: Visual Studio Build Tools with 'Desktop development with C\+\+' workload; macOS: Xcode Command Line Tools; Linux: python3, make, g\+\+, and libvips-dev \(for specific packages\)
Journey Context:
You run npm install on a project using bcrypt, sharp, sqlite3, or node-sass. The install fails with 'gyp ERR\! stack Error: \`gyp\` failed with exit code: 1' and mentions missing 'python', 'msbuild', or 'make'. These packages contain C\+\+ native addons that must be compiled against Node's V8 headers using node-gyp. Node-gyp requires Python 3 and a C\+\+ compiler toolchain. On Windows, the error specifically mentions 'Could not find any Visual Studio installation to use' because node-gyp needs the MSBuild system from Visual Studio Build Tools \(not the IDE itself\). The debugging journey involves downloading the Build Tools installer, selecting the 'Desktop development with C\+\+' workload \(~8GB\), and ensuring Python is in PATH \(or using npm config set python python3\). On macOS, xcode-select --install provides the clang compiler. On Linux \(Alpine/Debian\), installing build-essential and python3-dev provides gcc. Once the toolchain is present, node-gyp can generate the .node binary that Node requires.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:27:49.704464+00:00— report_created — created