Report #84175
[bug\_fix] Error: The module was compiled against a different Node.js version \(NODE\_MODULE\_VERSION mismatch\)
Run npm rebuild or delete node\_modules and npm install to recompile native addons against the current Node.js ABI. For packages like node-sass, ensure the version supports your Node version per the vendor's compatibility table.
Journey Context:
Developer switches Node versions using nvm \(e.g., from Node 16 to Node 18\) and attempts to run an existing project. Upon startup, Node crashes with 'NODE\_MODULE\_VERSION mismatch', indicating the addon was compiled for version 93 \(Node 16\) but current Node requires version 108 \(Node 18\). This occurs because native C\+\+ addons bind to specific V8/Node ABI versions. Developer tries npm install which may skip compilation if the package thinks it's already installed. They must force a rebuild: npm rebuild or rm -rf node\_modules && npm install. For problematic packages like node-sass, they consult the version compatibility table to ensure they're using a node-sass version that supports Node 18, upgrading the package if necessary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:52:41.975448+00:00— report_created — created