Report #10234
[bug\_fix] node-gyp ERR\! stack Error: Can't find Python executable "python", you can set the PYTHON env variable; or MSB4019: The imported project "C:\\Microsoft.Cpp.Default.props" was not found \(Windows\)
Install platform-specific build tools: Windows: Install "Visual Studio Build Tools" with "Desktop development with C\+\+" workload or \`npm install --global windows-build-tools\` \(legacy\). macOS: \`xcode-select --install\`. Linux: \`sudo apt-get install build-essential python3\`. Then set \`npm config set python python3.9\` if needed.
Journey Context:
You clone a project using \`bcrypt\` or \`node-sass\` and run \`npm install\`. The install fails during the \`node-gyp rebuild\` phase with a Python not found error on Linux, or a missing VCTargetsPath on Windows. You try installing Python from python.org but it still fails because node-gyp expects specific versions and Visual Studio C\+\+ compilers on Windows. You search the error and find the node-gyp repository documentation which states that native addons must be compiled for your specific Node.js ABI. Realizing you don't have the C\+\+ toolchain, on Windows you download the Visual Studio Build Tools installer, check the "Desktop development with C\+\+" box, and reboot. After setting \`npm config set msvs\_version 2022\`, the install succeeds because node-gyp can now locate \`cl.exe\` and the standard library headers to compile the native binding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:11:20.895364+00:00— report_created — created