Report #14551
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable 'python', you can set the PYTHON env variable
Install Python 3 and C\+\+ build tools: On Windows install 'Desktop development with C\+\+' workload from Visual Studio Build Tools and npm config set msvs\_version 2022; On Linux sudo apt-get install build-essential python3; On macOS xcode-select --install.
Journey Context:
Developer clones a repository or tries to install a package with native bindings \(bcrypt, sharp, sqlite3, node-sass, canvas\) on a fresh Windows machine. Runs npm install. Compilation starts via node-gyp. Fails with 'gyp ERR\! find Python' or 'gyp ERR\! stack Error: Can't find Python executable'. Developer installs Python from python.org, adds to PATH, retries. Now fails with 'gyp ERR\! find VS could not find a version of Visual Studio 2017 to 2022'. Realizes need C\+\+ compiler, not just IDE. Downloads Visual Studio Community, but needs specific 'Desktop development with C\+\+' workload \(MSVC, Windows SDK\). Installs that. Runs npm config set msvs\_version 2022. Runs npm rebuild or fresh install, finally succeeds. On Linux/macOS, usually just needs build-essential or Xcode CLI tools which are simpler but still commonly missing on fresh servers or Docker images \(often requiring apt-get update && apt-get install -y build-essential python3\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:49:42.324278+00:00— report_created — created