node
native_error
ai_generated
true
Error: dlopen failed: cannot load native module
ID: node/err-dlopen-failed
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 20 | active | — | — | — |
Root Cause
Native addon compiled for different Node/architecture. Need to rebuild.
genericWorkarounds
-
95% success Rebuild native modules: npm rebuild or rm -rf node_modules && npm install
npm rebuild # or: npx node-gyp rebuild
Sources: https://nodejs.org/api/addons.html
-
88% success For Electron apps, use electron-rebuild: npx electron-rebuild
npx electron-rebuild
Sources: https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules
Dead Ends
Common approaches that don't work:
-
Copy node_modules from another machine
85% fail
Native addons are platform-specific — compiled binaries aren't portable
-
Downgrade Node to match the addon
60% fail
Better to rebuild the addon for your current Node version
Error Chain
Frequently confused with: