-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better_sqlite3 was compiled against a different Node.js version #549
Comments
I get the same error... |
Met the same problem, you need to rebuild and postinstall In my package.json
|
I couldn't fix it but I had to reinstall my PC the next week and the second time I tried installing it it worked. |
Credit goes to https://stackoverflow.com/users/3712591/chitzui, I'm just re-posting here because this worked for me - From: https://stackoverflow.com/questions/46384591/node-was-compiled-against-a-different-node-js-version-using-node-module-version Require all dependencies you need in the main.js file that is run by electron. (this seemed to be the first important part for me) It is very important to run ./node_modules/.bin/electron-rebuild directly after npm i otherwise it did not work on my mac. |
Duplicate of #545 |
why is there dep on electron? |
I'll comment here because this was the first Google result about the subject. I had long lasting issues getting the better-sqlite3 rebuilding to work on Windows 11 and electron-forge. Finally, this was the package.json npm-script that worked: Run this with You don't have to have the rebuild library installed as it is part of electron-forge. If the rebuild process finishes immediately, it most likely did not do anything despite claiming that the process was a success. This threw me off. The goal is to rebuild what's found in node_modules/better-sqlite3, so go and see if the files have actually been changed. The CLI arguments found from rebuild repo are valuable when debugging the issue. |
I found that the electron-rebuild command only worked when I used the Not sure, but the fact that my electron app is a sub-project / npm workspace in a monorepo might be related. |
I tried |
IMHO, the problem is node_modules/better_sqlite3/build/config.gypi has line |
Any solution for that? |
worked for me also 💪 |
Error: The module 'path\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using
npm rebuild
ornpm install
).tried everything, any ideas?
The text was updated successfully, but these errors were encountered: