Report #17997
[bug\_fix] Error: The module '/path/to/node\_modules/bcrypt/lib/binding/napi-v3/bcrypt\_lib.node' was compiled against a different Node.js version using NODE\_MODULE\_VERSION 72. This version of Node.js requires NODE\_MODULE\_VERSION 83.
Run \`npm rebuild\` or \`rm -rf node\_modules && npm install\` to recompile native modules for the current Node version. If using Electron, run \`electron-rebuild\` or \`npx electron-rebuild\`. Root cause: Native Node.js addons \(NAPI/ABI\) are compiled against specific Node.js ABI versions; they are not forward/backward compatible across major Node versions.
Journey Context:
You switch from Node 14 to Node 16 using nvm to test a new feature. You run your Express app and it crashes immediately mentioning bcrypt\_lib.node and NODE\_MODULE\_VERSION 72 vs 83. You realize bcrypt is a native module. You try deleting node\_modules and reinstalling, but you forgot to clear the npm cache or the binary was cached. It still fails. You then run \`npm rebuild\` specifically, or simply \`rm -rf node\_modules && npm install\` after ensuring you're on the right Node version with \`node -v\`. The native module recompiles against Node 16's ABI 83 and the app starts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:54:49.331361+00:00— report_created — created