Report #5122
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python" or gyp ERR\! find VS msvs\_version not set
On Windows: Install "Desktop development with C\+\+" workload via Visual Studio Build Tools \(not just VS Code\). On macOS: \`xcode-select --install\`. Ensure Python 3.x is in PATH. Then \`npm rebuild\` or reinstall.
Journey Context:
Developer clones a project using native modules \(e.g., bcrypt, sqlite3, sharp, or old node-sass\) onto a fresh Windows machine. Running \`npm install\` fails during the postinstall phase with node-gyp errors about missing Python or Visual Studio. The developer installs Python from python.org and sets the \`PYTHON\` environment variable, but the error persists, now complaining about missing MSBuild or "Could not find any Visual Studio installation". Realizing that \`windows-build-tools\` npm package is deprecated and broken on Windows 11, the developer downloads the Visual Studio Build Tools installer from Microsoft, selects the "Desktop development with C\+\+" workload \(which includes MSVC v143 and Windows SDK\), and installs it. After opening a fresh PowerShell window to refresh env vars, \`npm install\` 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-15T20:41:37.689069+00:00— report_created — created