You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js 14.15.4
electron 12.0.0-beta.18
electron-rebuild 2.3.4
better-sqlite3 7.1.2
On Windows, better-sqlite3 is built against Node 14 (windows-build-tools with Python 2.7 are properly installed) and rebuilt against electron 12 using electron-rebuild. The resulting electron app works as expected.
On Linux (Arch Linux, same versions as above) better-sqlite3 is not built but installed via a prebuild binary. When I try to start the electron app with that binary I get the expected NODE_MODULE_VERSION mismatch error:
Error: The module '/home/renkei/Development/MyApp/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using NODE_MODULE_VERSION 85.
This version of Node.js requires NODE_MODULE_VERSION 87.
Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).
So, I run electron-rebuild like I do on Windows but on Linux nothing happens. After the log message Searching dependeny tree
I get immediately Rebuild Complete. The same happens when I use option -f or -w better-sqlite3 or both.
When I export DEBUG=* for more debug output I get without option -f:
Searching dependency tree
electron-rebuild skipping: better-sqlite3 as it is already built +52ms
✔ Rebuild Complete
and with option -f:
Searching dependency tree
Building module: better-sqlite3, Completed: 0
electron-rebuild assuming is prebuild powered: better-sqlite3 +0ms
electron-rebuild triggering prebuild download step: better-sqlite3 +0ms
Building module: better-sqlite3, Completed: 0
electron-rebuild built: better-sqlite3 +106ms
✔ Rebuild Complete
Any idea, why the the recompile step is not properly triggered?
The text was updated successfully, but these errors were encountered:
I've solved this with a postinstall script in package.json that runs electron-rebuild on Windows and a self-made shell script on Linux that executes npm install better-sqlite3 again, but this time npm is re-configured to build directly for electron, like suggested by the electron documentation as an alternative to electron-rebuild, works perfectly for me.
#!/bin/bash# Electron's version.export npm_config_target=$1# The architecture of Electron, see https://electronjs.org/docs/tutorial/support#supported-platforms# for supported architectures.export npm_config_arch=x64
export npm_config_target_arch=x64
# Download headers for Electron.export npm_config_disturl=https://electronjs.org/headers
# Tell node-pre-gyp that we are building for Electron.export npm_config_runtime=electron
# Tell node-pre-gyp to build module from source code.export npm_config_build_from_source=true
# Install all dependencies, and store cache to ~/.electron-gyp.
HOME=~/.electron-gyp npm install better-sqlite3
Node.js
14.15.4
electron
12.0.0-beta.18
electron-rebuild
2.3.4
better-sqlite3
7.1.2
On Windows, better-sqlite3 is built against Node 14 (windows-build-tools with Python 2.7 are properly installed) and rebuilt against electron 12 using electron-rebuild. The resulting electron app works as expected.
On Linux (Arch Linux, same versions as above) better-sqlite3 is not built but installed via a prebuild binary. When I try to start the electron app with that binary I get the expected
NODE_MODULE_VERSION
mismatch error:So, I run electron-rebuild like I do on Windows but on Linux nothing happens. After the log message
Searching dependeny tree
I get immediately
Rebuild Complete
. The same happens when I use option-f
or-w better-sqlite3
or both.When I
export DEBUG=*
for more debug output I get without option-f
:and with option
-f
:Any idea, why the the recompile step is not properly triggered?
The text was updated successfully, but these errors were encountered: