Report #70297
[bug\_fix] gyp ERR\! build error; gyp ERR\! stack Error: \`make\` failed with exit code: 2 while building a native addon
Install the platform C\+\+ build toolchain and Python. On Debian/Ubuntu: \`sudo apt-get install build-essential python3 make g\+\+\`. On macOS: \`xcode-select --install\`. On Windows: install the Visual Studio C\+\+ workload. Then \`npm config set python python3\` if needed and \`npm rebuild \`.
Journey Context:
You run \`npm install\` on a project using \`bcrypt\` or \`sqlite3\` and it fails during the postinstall build with \`gyp ERR\! build error\` and a long \`make\` stack trace. The log complains that Python or a C\+\+ compiler cannot be found. You are on a fresh Linux container with only Node installed; \`gcc\`, \`make\`, and \`python3\` are missing. node-gyp needs these to compile the native \`.node\` binding against your current Node headers. After installing \`build-essential\` and \`python3\`, you run \`npm rebuild bcrypt\` and the compilation succeeds because the native code can now be compiled and linked for your ABI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:34:14.794675+00:00— report_created — created