Report #71263
[bug\_fix] Error: The module '...' was compiled against a different Node.js version using NODE\_MODULE\_VERSION XX. This version of Node.js requires NODE\_MODULE\_VERSION YY
Run npm rebuild to recompile native addons against the current Node.js ABI. If that fails, delete node\_modules and package-lock.json \(or yarn.lock/pnpm-lock.yaml\) and run a clean install. For Electron apps, use electron-rebuild. Root cause: Native C\+\+ addons bind to a specific Node.js Application Binary Interface \(ABI\) version; switching Node.js versions \(e.g., 16 to 18\) without rebuilding breaks the binary compatibility.
Journey Context:
Switched from Node.js 16 to 18 for LTS support using nvm. Ran the app and immediately crashed with NODE\_MODULE\_VERSION 93 vs 108 error referencing bcrypt.node. Tried npm install which didn't help because it used cached compiled binary. Deleted node\_modules and package-lock, ran npm install again. This time node-gyp triggered and recompiled bcrypt against Node 18 headers. App started successfully. Later added 'engines' field to package.json to prevent version mismatches.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:11:37.026658+00:00— report_created — created