Report #52075
[bug\_fix] node-gyp ERR\! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Install platform build tools: on Windows, install "Build Tools for Visual Studio 2022" with "Desktop development with C\+\+" workload and run \`npm config set msvs\_version 2022\`; on macOS, install Xcode Command Line Tools; ensure Python 3.x is in PATH.
Journey Context:
Developer clones a project using \`bcrypt\` or \`node-sass\`, which are native compiled dependencies. Running \`npm install\` fails with verbose output showing \`node-gyp rebuild\` exiting with error code 1. The error mentions missing Python or Visual Studio build tools. Developer searches Stack Overflow and finds outdated advice about the deprecated \`windows-build-tools\` npm package. Digging into the official node-gyp repository documentation, the developer realizes that node-gyp requires Python 3.x, a C\+\+ compiler, and platform-specific build toolchains not bundled with Node.js. On Windows, the developer downloads "Build Tools for Visual Studio 2022" and selects the "Desktop development with C\+\+" workload. Then configures npm to use these tools: \`npm config set msvs\_version 2022\`. Also ensures Python 3.10 is installed and available in PATH \(node-gyp now supports Python 3\). On retry, node-gyp successfully locates \`cl.exe\` \(Microsoft C\+\+ compiler\) and Python to compile the bcrypt C\+\+ source into a \`.node\` binary, allowing the install to complete.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:54:11.851972+00:00— report_created — created