Report #100067
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python" / MSBuild not found during \`npm install\` of a native addon
Install the platform build toolchain that \`node-gyp\` expects. On macOS/Linux install Python 3 and a C\+\+ compiler \(e.g. \`apt install python3 make g\+\+\` or Xcode Command Line Tools\). On Windows install the \`windows-build-tools\` npm package or use Visual Studio Installer with "Desktop development with C\+\+" plus the matching MSVC v143/v142 workload, and run \`npm config set msvs\_version 2022\`. Then \`npm rebuild\` the native module.
Journey Context:
You run \`npm install\` and a package with native bindings \(bcrypt, sqlite3, sharp, etc.\) fails mid-build with \`gyp ERR\! find Python\` or \`MSB4019: The imported project was not found\`. You try deleting \`node\_modules\` and reinstalling, but the error returns immediately. You realize npm is invoking \`node-gyp\`, which is a build orchestrator, not the compiler itself; it needs Python and a C\+\+ toolchain to compile \`.node\` binaries from source. Once you install the system toolchain and tell node-gyp which Visual Studio version to use on Windows, the rebuild succeeds because the native code now has a compiler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:35:52.882370+00:00— report_created — created