Electron build error when attempting to use sqlite in app

Wappler Version: 5.5.3
Operating System: Windows 11
Server Model: node.js
Database Type: postgres
Hosting Type: N/A

Expected behavior

The build of the Electron app should happen without errors.

Actual behavior

The build fails with the following error related to the node-gyp module.

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: Could not find any Python installation to use
Error: node-gyp failed to rebuild 'C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\sqlite3'.
    at NodeGyp.rebuildModule (C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:120:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ModuleRebuilder.rebuildNodeGypModule (C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:98:9)
    at async ModuleRebuilder.rebuild (C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:128:14)
    at async Rebuilder.rebuildModuleAt (C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\rebuild.js:149:13)
    at async Rebuilder.rebuild (C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\rebuild.js:112:17)
    at async C:\Users\Keith\Documents\Brightyard_Desktop_App_v3\electron\node_modules\electron-rebuild\lib\src\cli.js:158:9
Build error 4294967295: 

How to reproduce

This appears to be related to one of the three dependencies that Wappler adds in package.json when trying to use any of the capacitor sqlite actions on a page.

    "capacitor-community/sqlite": "^4.5.0",
    "jeep-sqlite": "^1.6.9",
    "sql.js": "^1.8.0"

My initial troubleshooting search is finding answers that either say to install python or use a different version of sqlite. Not sure what is the correct approach at the moment or if there is another solution.

There were a few steps I had to go through to get this working.

  1. Make sure there are no spaces in the directory path. I had to rename my Wappler folder to replace spaces with underscores.
  2. Install Python 3.10
  3. Set Python path in Environment variables
  4. Install the Windows Standalone Build Tools. While installing, choose the “Desktop development with C++” workload option.


4. Run the following command with the year/version of the Standalone Build Tools installed.

npm config set msvs_version 2022
  1. Restart computer

That was all that I needed to successfully build and package Electron after adding sqlite functionality to my app.

Other potential steps can be found here. if the above does not work.

2 Likes

When installing NodeJS on windows with the official installer, there is an option in the install wizard to also install all the build tools and chokolatey

This will then setup everything and save you some time.

I think that was set, but not 100% sure. I haven’t had issues with anything until now.