Report #7469
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR\! stack Error: \`gyp\` failed with exit code: 1
On Windows: Install Visual Studio Build Tools with 'Desktop development with C\+\+' workload and Python 3.x \(from python.org\), then npm config set msvs\_version 2022 --global. On macOS: Install Xcode Command Line Tools \(xcode-select --install\). On Linux: Install build-essential and python3 \(apt-get install build-essential python3\).
Journey Context:
Developer attempts to npm install a package with native dependencies like bcrypt, sharp, or sqlite3 on a fresh Windows machine. Installation spins, then dumps node-gyp errors about missing Python or MSBuild. Developer realizes these packages contain C\+\+ code that must be compiled. On Windows, installs 'Desktop development with C\+\+' via Visual Studio Build Tools \(not full VS\), downloads Python 3.11, sets npm config set python python3.exe and npm config set msvs\_version 2022. Retries install, compilation succeeds. On macOS, simply running xcode-select --install provides the clang compiler. On Ubuntu, sudo apt install build-essential python3.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:46:03.581097+00:00— report_created — created