Report #8877
[bug\_fix] node-gyp rebuild failed: gyp ERR\! find Python / gyp ERR\! find VS
On Windows: npm install --global windows-build-tools \(legacy\) or install Visual Studio 2022 Build Tools with 'Desktop development with C\+\+' workload; on macOS: install Xcode Command Line Tools; on Linux: install build-essential, python3, make. Then npm config set python python3. Root cause: Native C\+\+ Node.js addons must be compiled for the specific Node.js ABI version, requiring Python \(for build scripts\) and a C\+\+ compiler toolchain \(GCC/MSVC\).
Journey Context:
Attempted to install bcrypt or sharp on a fresh Windows laptop, got massive stack trace ending with node-gyp failing to find Python executable and MSBuild. Downloaded Python 3.11 manually, added to PATH, still failed because it specifically needs the MS Visual C\+\+ compiler which isn't included in standard Windows. Installed full Visual Studio IDE \(6GB\), still didn't work because node-gyp couldn't find it. Finally discovered the specific 'windows-build-tools' npm package or the VS Build Tools installer with exact C\+\+ workload checkbox, and the npm config set msvs\_version 2022 command, which allowed the native module to compile.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:43:14.885232+00:00— report_created — created