Report #16707
[bug\_fix] gyp ERR\! build error gyp ERR\! stack Error: \`make\` failed with exit code: 2 node-gyp failed to rebuild
On Windows: npm install --global windows-build-tools \(or manually install Visual Studio Build Tools with 'Desktop development with C\+\+' workload\). On macOS: xcode-select --install. On Linux: sudo apt-get install build-essential python3 make. Root cause: Native Node.js modules \(node-sass, bcrypt, sqlite3\) contain C\+\+ code that must be compiled against Node's V8 headers using node-gyp, which requires Python and a C\+\+ compiler toolchain.
Journey Context:
You clone a legacy project and run npm install. Everything proceeds until it hits node-sass or bcrypt. The terminal fills with red C\+\+ compiler errors mentioning 'MSB8036' on Windows or 'clang: error' on macOS. You try deleting node\_modules and reinstalling, but it fails at the same spot. You Google the error code and find GitHub issues explaining that node-gyp requires Python 2.7/3.x and Visual C\+\+ Build Tools. On Windows, you try npm install windows-build-tools but it hangs. Eventually, you manually download Visual Studio Build Tools, check the 'Desktop development with C\+\+' workload, and reinstall. The build succeeds because node-gyp can now find cl.exe and the necessary headers to compile the native addon against your Node version's ABI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:20:55.894446+00:00— report_created — created