Report #61167
[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 or delete node\_modules and run npm install. For Electron apps, use electron-rebuild. Root cause: Native Node.js addons \(.node files\) are compiled C\+\+ binaries bound to a specific Node.js ABI \(Application Binary Interface\) version. When upgrading Node.js \(e.g., 14.x to 16.x\), the ABI version changes \(e.g., 83 to 93\), invalidating previously compiled native modules.
Journey Context:
Upgraded Node.js from 14 to 16 using nvm install 16 && nvm use 16. Running the existing application throws 'Error: The module /node\_modules/bcrypt/lib/binding/napi-v3/bcrypt.node was compiled against a different Node.js version using NODE\_MODULE\_VERSION 72. This version of Node.js requires NODE\_MODULE\_VERSION 83'. Checking node -p process.versions.modules confirms the new version is 83. The bcrypt package contains a native C\+\+ addon compiled for Node 14 \(ABI 72\). Attempting to run npm start again fails. Running npm rebuild triggers node-gyp to recompile the native addon against the current Node.js headers and V8 ABI. Alternatively, rm -rf node\_modules && npm install achieves the same. In an Electron context, using electron-rebuild is necessary because Electron uses a different ABI than the system Node.js.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:09:08.867998+00:00— report_created — created