Report #71251
[bug\_fix] node-gyp rebuild failed: gyp ERR\! find Python / gyp ERR\! find VS
Install Visual Studio Build Tools 2022 with the 'Desktop development with C\+\+' workload and ensure Python 3.10\+ is in PATH \(or use npm config set python python3\). On macOS, install Xcode Command Line Tools \(xcode-select --install\). Then run npm rebuild. Root cause: Native C\+\+ addons must be compiled against Node.js headers using a C\+\+ compiler and Python build scripts.
Journey Context:
Ran npm install on a project using bcrypt and sharp. Immediately got red errors about missing Python and MSBuild. Installed Python 3.11 manually, still failed because Visual Studio wasn't found. Downloaded Visual Studio Community but didn't select C\+\+ workload. After 3 failed rebuild attempts, found the node-gyp README which specified exact VS workload needed. Used 'npm config set msvs\_version 2022' and 'npm config set python python3', then rebuild worked.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:10:35.430671+00:00— report_created — created