Report #35841
[bug\_fix] gyp ERR\! find Python gyp ERR\! stack Error: Can't find Python executable "python" OR MSB4019: The imported project "C:\\Microsoft.Cpp.Default.props" was not found
Install platform-specific native build tools: Windows: Visual Studio Build Tools 2019/2022 with "Desktop development with C\+\+" workload. macOS: Xcode Command Line Tools \(xcode-select --install\). Linux: build-essential \(gcc/g\+\+\) and python3-distutils. Then ensure npm is configured to use the installed Python via npm config set python /path/to/python3 if needed.
Journey Context:
Developer attempts to install a package with native C\+\+ bindings such as bcrypt, sharp, sqlite3, node-sass, or Prisma client on a fresh machine, Docker container \(like node:alpine\), or CI environment. The installation fails during the node-gyp rebuild phase with errors indicating Python is not found \(gyp ERR\! find Python\) or that make/gcc is missing on Unix, or that MSBuild/Microsoft.Cpp.Default.props is missing on Windows. Developer tries installing node-gyp globally \(npm install -g node-gyp\) which fails because node-gyp itself requires the system tools. They realize node-gyp is not a standalone compiler but a build orchestrator that requires Python 3.x and a C\+\+ compiler toolchain \(GCC/Clang/MSVC\) to be pre-installed on the system. The fix involves installing "Build Tools for Visual Studio 2022" on Windows \(selecting C\+\+ build tools\), running xcode-select --install on macOS, or apt-get install build-essential python3 on Linux.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:38:10.732772+00:00— report_created — created