Report #3823
[bug\_fix] ELIFECYCLE node-gyp rebuild failed - Native module compilation error
On Ubuntu/Debian: \`sudo apt-get install build-essential python3\`. On macOS: \`xcode-select --install\`. On Windows: Install \`windows-build-tools\` or Visual Studio Build Tools with C\+\+ workload. Alternatively, replace the native module with a pure JavaScript equivalent \(e.g., \`bcrypt\` → \`bcryptjs\`, \`node-sass\` → \`sass\`\).
Journey Context:
Developer clones an Express API using \`bcrypt\` for password hashing. On \`npm install\`, the process fails at \`node-gyp rebuild\` with "gyp ERR\! stack Error: not found: make" on Ubuntu. Developer installs \`make\` via \`sudo apt install make\`, but then it complains about \`g\+\+\`. They install \`build-essential\` but now node-gyp reports "Python executable not found" or incompatible Python version \(3.11 vs required 3.10\). They realize native modules compile C\+\+ against Node's V8 headers and require exact toolchain versions. After struggling with Python paths, they discover that \`bcryptjs\` is a pure JS drop-in replacement with no compilation. They switch to that, install succeeds instantly, and tests pass with minimal performance difference.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:17:04.403979+00:00— report_created — created