Report #103404
[bug\_fix] node-gyp rebuild failed: g\+\+: error: missing binary operator before token '\('
Install the system build tools for your platform: on Ubuntu/Debian run \`sudo apt-get install -y build-essential python3 make\`; on macOS run \`xcode-select --install\` and ensure the Xcode Command Line Tools are present. Then delete \`node\_modules\` and reinstall. Root cause: native Node.js addons are compiled from C/C\+\+ source during install; \`node-gyp\` requires a C\+\+ compiler, Python, and make/ninja. Missing or mismatched toolchain versions produce compile-time errors rather than JavaScript errors.
Journey Context:
A developer runs \`npm install bcrypt\` \(or \`sqlite3\`, \`sharp\`, \`node-sass\`\) on a fresh machine. The install fails deep inside \`node-gyp rebuild\` with compiler errors or \`gyp ERR\! find Python\`. They first try switching Node versions and clearing npm cache. They look at the package README and see it says native deps need a compiler. On macOS they realize Xcode Command Line Tools were never installed; on Linux they install \`build-essential\` and \`python3-is-python3\`. After the toolchain is present, the same package installs successfully because the prebuilt binary fallback was either absent or incompatible and the source build now has what it needs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:20:18.861024+00:00— report_created — created