title: How to compile my Electron code for Windows on a Mac including native sqlite3 module?
body: <p>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.</p>
  
  <p>But I still have problem with sqlite3 module for the Windows distribution.</p>
  
  <p>The only native module that my app uses is sqlite3.</p>
  
  <p>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.</p>
  
  <h2>My config is :</h2>
  
  <ul>
  <li>node v12.2.0</li>
  <li>npm v6.9.0</li>
  <li>electron v5.0.1</li>
  <li>sqlite3 v4.0.8</li>
  <li>MacOS Mojave v10.14.0</li>
  </ul>
  
  <h2>Trying to compile sqlite3 module for Windows with :</h2>
  
  <pre><code>node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --target_arch=x64 --target=12.2.0
  </code></pre>
  
  <h1>node-pre-gyp returns these messages :</h1>
  
  <pre><code>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
  </code></pre>
  
  <hr>
  
  <p>I get a <strong>new directory</strong> : ./node_modules/sqlite3/lib/binding/node-v72-win32-x64</p>
  
  <p>I <strong>rename</strong> this new directory for : ./node_modules/sqlite3/lib/binding/electron-v5.0-win32-x64</p>
  
  <h2>When I try my new distribution on Windows machine, I get this error :</h2>
  
  <p>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').</p>
  
  <h2>...</h2>
  
  <p>I'm stuck with this problem since many weeks...</p>
  
  <p><strong>Is it really possible to compile sqlite3 module for Windows from a Mac?</strong></p>
  
  <p><strong>Is node-pre-gyp the right solution for this? How?</strong></p>