Report #52605
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python", you can set the PYTHON env variable / gyp ERR\! find VS msvs\_version not set
On Windows, install Visual Studio Build Tools \(C\+\+ workload\) and Python 3.x, then run \`npm config set msvs\_version 2022\` \(or 2019\) and \`npm config set python python3.exe\`. On macOS, install Xcode Command Line Tools.
Journey Context:
Developer on Windows clones a repo and runs \`npm install\`. It fails during the postinstall phase of \`bcrypt\` or \`sharp\` with 'Can't find Python executable'. Developer installs Python 3.10 from python.org, retries, now gets 'Could not find any Visual Studio installation'. They learn that node-gyp requires the C\+\+ compiler toolchain, not just the Python interpreter. The rabbit hole involves checking \`npm config get msvs\_version\`, finding it's empty, and realizing they need the 'Desktop development with C\+\+' workload in Visual Studio Build Tools \(not just VS Code\). After installing the build tools \(~6GB\), setting \`npm config set msvs\_version 2022\`, and reinstalling, the native module compiles because node-gyp can now locate the MSBuild.exe and cl.exe compiler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:47:29.079540+00:00— report_created — created