Report #100973
[bug\_fix] gyp ERR\! build error stack Error: \`make\` failed with exit code: 2 gyp ERR\! not ok npm ERR\! code 1
Install the platform build toolchain: on Debian/Ubuntu run sudo apt install build-essential python3 make g\+\+; on macOS run xcode-select --install; on Windows install Visual Studio Build Tools with the 'Desktop development with C\+\+' workload. Then delete node\_modules and npm install again, or run npm rebuild.
Journey Context:
You run npm install on a project using bcrypt, sharp, or sqlite3 and the install fails halfway through with a wall of C\+\+ compiler errors. The log mentions node-gyp, binding.gyp, and missing Python or make. You first try npm install --build-from-source with no luck. You realize node-gyp is a wrapper that compiles native C\+\+ addons against Node's headers, and your machine simply lacks a compiler. On Ubuntu you install build-essential and python3; on macOS the Xcode command-line tools; on Windows the VS Build Tools. After that, npm rebuild succeeds because gyp can now invoke the compiler to build the native module against your Node ABI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:46:28.819383+00:00— report_created — created