Report #39988
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python"
Install Python 3.x and ensure it is available in the system PATH, or set the PYTHON environment variable to the Python executable path. On Windows, install the Visual Studio Build Tools with the "Desktop development with C\+\+" workload.
Journey Context:
A developer clones a project that depends on a native Node.js addon \(e.g., bcrypt, sharp, or sqlite3\). They run npm install. The install proceeds until it hits a package requiring compilation. The output shows node-gyp attempting to rebuild the addon but failing with "Can't find Python executable". The developer is on Windows and doesn't have Python installed, or has it installed but not in PATH. They install Python 3.10 from python.org and add it to PATH. They retry npm install. Now node-gyp progresses further but fails with "Could not find any Visual Studio installation". They realize they need the C\+\+ compiler toolchain, not just Python. They download the Visual Studio Build Tools 2022 installer, select "Desktop development with C\+\+", and install. After reopening the terminal, 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-18T21:35:37.059428+00:00— report_created — created