Report #27236
[bug\_fix] gyp ERR\! build error ... MSBuild.exe not found or Python executable not found
Install platform-specific build tools: on Windows, install Visual Studio Build Tools with the "Desktop development with C\+\+" workload and Python 3; on macOS, run xcode-select --install; on Linux, install build-essential and python3.
Journey Context:
A developer clones a repository that depends on bcrypt for password hashing or sharp for image processing. They run npm install. The install proceeds until it hits a native addon that requires compilation. The terminal fills with errors from node-gyp: MSBuild.exe not found on Windows, or Python executable not found, or make failed with exit code 2 on Linux. The developer realizes these packages contain C\+\+ addons that must be compiled against the current Node.js ABI. On Windows, they try npm install --global windows-build-tools but it hangs or fails because it's deprecated. They manually download Visual Studio Build Tools, run the installer, and select the "Desktop development with C\+\+" workload including Windows 10/11 SDK. They also install Python 3 from python.org and ensure python is in the system PATH \(or run npm config set python python3.exe\). They delete node\_modules and retry npm install. The native modules compile successfully. They understand that node-gyp requires a compiler toolchain matching the one used to build Node.js itself.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:06:36.200314+00:00— report_created — created