Report #36799
[bug\_fix] gyp ERR\! build error or gyp ERR\! find Python
Install platform-specific C\+\+ build toolchain: Windows: Visual Studio Build Tools with 'Desktop development with C\+\+' workload or npm install --global windows-build-tools; macOS: xcode-select --install; Linux: sudo apt-get install build-essential python3 make.
Journey Context:
Developer clones a repository or runs npm install on a project containing native Node.js addons \(common packages: bcrypt, sqlite3, sharp, node-sass, nodegit, or old versions of native modules\). The installation reaches the 'rebuild' or 'postinstall' step and fails with 'gyp ERR\! build error' or 'gyp ERR\! find Python'. On Windows, the error specifically mentions 'Could not find any Visual Studio installation', 'missing MSBuild', or 'Python executable not found in PATH'. On macOS, it mentions 'xcrun: error: invalid active developer path'. On Linux, it mentions 'make failed with exit code 2' or 'gcc: command not found'. The root cause is that node-gyp \(Node.js's native addon build tool\) requires Python 3.x and a C\+\+ compiler toolchain to compile C\+\+ source files into .node binary addons. The fix involves installing the platform-specific compiler toolchain: on Windows, installing Visual Studio Build Tools with the 'Desktop development with C\+\+' workload \(or the deprecated windows-build-tools npm package\), on macOS installing Xcode Command Line Tools, and on Linux installing build-essential and python3.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:14:35.230321+00:00— report_created — created