Report #21005
[bug\_fix] gyp ERR\! find Python / gyp ERR\! find VS msvs\_version not set
Install Visual Studio Build Tools with the "Desktop development with C\+\+" workload and Python 3.x \(available in the Build Tools installer or Microsoft Store\), then configure npm: npm config set msvs\_version 2022 and npm config set python python3. Root cause: node-gyp requires a C\+\+ compiler toolchain and Python to compile native addons against Node.js V8 headers.
Journey Context:
A developer on Windows clones a repository that uses bcrypt for password hashing or sharp for image processing. Running npm install triggers a node-gyp rebuild that immediately fails with errors about being unable to find Python and Visual Studio. The developer installs Python 2.7 from python.org, but the error persists because node-gyp now requires Python 3. They then try npm install -g windows-build-tools, which hangs indefinitely or fails on newer Windows versions. After reading the node-gyp repository documentation, they realize they need the actual Visual Studio Build Tools 2022 installer from Microsoft, specifically checking the "Desktop development with C\+\+" workload which includes MSVC and Windows SDK. After installation, they set the npm configuration to point to the new Visual Studio version and Python 3 executable. Running npm install again successfully compiles the native addon.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:39:41.141844+00:00— report_created — created