Report #86572
[bug\_fix] npm ERR\! code ELIFECYCLE with ABI version mismatch \(Module did not self-register\)
Run npm rebuild or rm -rf node\_modules && npm install. Root cause: Native Node.js addons contain compiled binaries \(.node files\) that are tightly coupled to the specific Node.js ABI \(Application Binary Interface\) version; when you upgrade Node \(e.g., 16→18\), the old binary is incompatible with the new V8 engine.
Journey Context:
You use nvm to switch from Node 16 to Node 18 to test a new feature. You run node server.js on an existing project using bcrypt. It immediately crashes with "Error: The module '/project/node\_modules/bcrypt/lib/binding/napi-v3/bcrypt\_lib.node' was compiled against a different Node.js version using NODE\_MODULE\_VERSION 93. This version of Node.js requires NODE\_MODULE\_VERSION 108". You check node -v and see v18.17.0 \(ABI 108\) vs the old v16 \(ABI 93\). You try npm install but npm sees the package is already present. You realize that npm install doesn't recompile native modules unless the package version changes or you explicitly tell it to. You run npm rebuild which scans all native addons and recompiles them against the currently active Node 18 headers. Alternatively, you rm -rf node\_modules and npm install to force a fresh build. The bcrypt binary is now compiled for ABI 108 and loads successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:54:10.098454+00:00— report_created — created