My goal is to create a distribution for Mac AND an other for Windows. I want to create these two distributions from my Mac. For the moment, my distribution for Mac works well.
But I still have problem with sqlite3 module for the Windows distribution.
The only native module that my app uses is sqlite3.
I really don't know what to do to finally get my app works correctly on Windows. I don't want to compile my code on a Windows machine. I want to compile my code on my Mac only.
My config is :
- node v12.2.0
- npm v6.9.0
- electron v5.0.1
- sqlite3 v4.0.8
- MacOS Mojave v10.14.0
Trying to compile sqlite3 module for Windows with :
node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --target_arch=x64 --target=12.2.0
node-pre-gyp returns these messages :
node-pre-gyp WARN Using request for node-pre-gyp https download
Warning: node-pre-gyp could not find exact match for 12.2.0
Warning: but node-pre-gyp successfully choose 12.0.0 as ABI compatible target
Warning: node-pre-gyp could not find exact match for 12.2.0
Warning: but node-pre-gyp successfully choose 12.0.0 as ABI compatible target
[sqlite3] Success: "/Users/Flooder/Programmes/electron/c4/node_modules/sqlite3/lib/binding/node-v72-win32-x64/node_sqlite3.node" is installed via remote
I get a new directory : ./node_modules/sqlite3/lib/binding/node-v72-win32-x64
I rename this new directory for : ./node_modules/sqlite3/lib/binding/electron-v5.0-win32-x64
When I try my new distribution on Windows machine, I get this error :
Uncaught Exception: Error: The module D:\c4\resources\app\node_modules\sqlite3\lib\binding\electron-v5.0-win32-x64\node_sqlite3.node was compiled against a different Node.js version using NODE_MODULE 72. This version of Node.js requires NODE_MODULE_VERSION 70. Please try re-compiling or re-installing the module (for instance, using 'npm rebuild' or 'npm install').
...
I'm stuck with this problem since many weeks...
Is it really possible to compile sqlite3 module for Windows from a Mac?
Is node-pre-gyp the right solution for this? How?
node-canvas
– ("NODE_MODULE_VERSION " mismatch, etc.). Spent a few days juggling versions of everything but finally gave up. – spring