This error occurs when a native module's compiled binary doesn't match your current Node.js version. The NODE_MODULE_VERSION ABI changed, requiring recompilation.
This error means a native module (C++ addon) was compiled for a different Node.js version than you're currently running. Native modules are compiled to a specific ABI (Application Binary Interface) version, identified by NODE_MODULE_VERSION. Each Node.js major version has a different ABI: - Node.js 16.x = ABI 93 - Node.js 18.x = ABI 108 - Node.js 20.x = ABI 115 - Node.js 22.x = ABI 127 When these don't match, the module can't load. This commonly happens when: - You upgraded Node.js but didn't reinstall node_modules - You copied node_modules from another machine - Different Node.js versions in development vs production
The quickest fix is to rebuild all native modules:
npm rebuildThis recompiles all native modules for your current Node.js version.
For a completely fresh build:
rm -rf node_modules package-lock.json
npm installThis removes all cached binaries and reinstalls everything.
Ensure you're using the same Node.js everywhere:
# Check current version
node --version
# Check which node is being used
which node
# If using nvm, verify active version
nvm currentAlso check that your IDE/editor is using the same Node.js version as your terminal.
If you know which package is problematic:
npm rebuild bcrypt
# or
npm rebuild sqlite3Don't copy node_modules into Docker. Add to .dockerignore:
node_modulesLet Docker install fresh:
FROM node:20
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .Common affected packages: bcrypt, sqlite3, canvas, sharp, node-sass, leveldown—any package with C++ native code.
Prevention:
- Use .nvmrc to lock Node.js version
- Never copy node_modules between environments
- Run npm rebuild after Node.js upgrades
- Use same Node.js version in CI/CD as development
ABI version lookup: Check which ABI your Node.js uses:
node -p "process.versions.modules"package-lock.json: The lock file may reference wrong platform binaries. Deleting it ensures fresh resolution for your platform.
npm error code E401 npm error Incorrect or missing password.
How to fix 'E401 Unable to authenticate' errors with npm private registries
npm ERR! code EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code EMPTYPACKAGE npm ERR! Package contains no files
How to fix 'npm ERR! code EMPTYPACKAGE' - Package contains no files
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm