Report #29068
[bug\_fix] Error: The module was compiled against a different Node.js version using NODE\_MODULE\_VERSION 72. This version of Node.js requires NODE\_MODULE\_VERSION 83. \| Error: Module did not self-register.
Rebuild native modules against the current Node.js version using npm rebuild, or delete node\_modules and run npm install again. For Electron apps, use electron-rebuild. For version managers, ensure the correct Node.js version is active matching the binary.
Journey Context:
Developer switches Node.js versions using nvm use 18 \(from 14\) or upgrades the system Node.js installation. Upon running an existing project that depends on native modules \(e.g., bcrypt, sqlite3, sharp, node-sass\), the application crashes immediately with 'MODULE\_VERSION mismatch' or 'was compiled against a different Node.js version'. The error indicates the addon was compiled for ABI version 72 \(Node 12\) but the current Node is 83 \(Node 14\) or 93 \(Node 16\), etc. The developer initially tries deleting node\_modules and reinstalling, which works if prebuilt binaries are available for the new Node version. If not, the native source must be recompiled. Running npm rebuild triggers node-gyp to recompile the C\+\+ sources against the currently active Node.js headers and V8 ABI. For Electron applications \(which have a different ABI than Node.js\), electron-rebuild must be used instead to match Electron's specific NODE\_MODULE\_VERSION.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:10:55.872020+00:00— report_created — created