Report #10495
[bug\_fix] gyp ERR\! build error / Can't find Python executable / MSB4019 \(missing build tools\)
Root cause: Native Node.js addons \(C\+\+ extensions like bcrypt, sqlite3, node-sass\) must be compiled from source for the specific Node.js ABI version using \`node-gyp\`. This requires Python 3.x and a C\+\+ compiler toolchain \(GCC on Linux, Xcode Command Line Tools on macOS, or Visual Studio Build Tools on Windows\). If these are missing, incorrectly installed, or not in PATH, the rebuild fails. Fix: \*\*Windows\*\*: Install Visual Studio Build Tools 2022 with the 'Desktop development with C\+\+' workload and ensure Python 3 is installed \(or use \`npm install --global windows-build-tools\` on older Node versions\). \*\*macOS\*\*: Install Xcode Command Line Tools \(\`xcode-select --install\`\). \*\*Linux\*\*: Install \`build-essential\` \(or \`gcc-c\+\+\`, \`make\`\) and \`python3\` \(e.g., \`sudo apt-get install build-essential python3\`\). Alternatively, avoid building by switching to pure-JS alternatives \(e.g., \`bcryptjs\` instead of \`bcrypt\`\).
Journey Context:
Developer clones a repo using \`bcrypt\` or \`sqlite3\`. Runs \`npm install\`. Sees a wall of red text ending with \`gyp ERR\! build error\` and \`node-gyp failed to rebuild\`. On Windows, error mentions \`MSB4019: The imported project 'C:\\Microsoft.Cpp.Default.props' was not found\`. On Mac, mentions \`xcode-select: error: tool 'xcodebuild' requires Xcode\`. Developer tries installing Python manually, but still fails. Eventually finds a Stack Overflow answer explaining node-gyp prerequisites. On Windows, downloads Visual Studio Build Tools 2022 installer, checks 'C\+\+ build tools', installs 4GB of tools. On Mac, runs \`xcode-select --install\`. Retries \`npm install\`, native module compiles successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:49:20.747911+00:00— report_created — created