Report #78480
[bug\_fix] gyp ERR\! find Python / gyp ERR\! find VS / node-gyp rebuild failed
Root cause: Native Node.js addons \(packages like bcrypt, sharp, sqlite3\) contain C\+\+ code that must be compiled for the specific Node.js ABI and platform using node-gyp. node-gyp requires Python 3.x and a C\+\+ compiler toolchain \(GCC on Linux, Xcode Command Line Tools on macOS, Visual Studio Build Tools on Windows\). The fix is platform-specific: On Windows, install Visual Studio Build Tools with the 'Desktop development with C\+\+' workload and run npm config set msvs\_version 2022; on macOS, run xcode-select --install; on Linux \(Debian/Ubuntu\), run apt-get install build-essential python3 make.
Journey Context:
You run npm install on a project using bcrypt or sharp. The install halts with verbose gyp errors about missing Python or Visual Studio. On Windows, you see 'Could not find any Visual Studio installation to use'. You install Python from python.org, but the error persists because node-gyp also needs the Windows build tools. You try npm install --global windows-build-tools \(an old deprecated package\) which hangs or fails. You eventually find the official node-gyp documentation stating you need Visual Studio Build Tools, not the full IDE. You download the Build Tools installer, check the 'Desktop development with C\+\+' workload, and install. You then run npm config set msvs\_version 2022 to tell node-gyp which version to use. On retry, gyp finds the compiler and builds the native addon successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:19:34.064408+00:00— report_created — created