I'm trying to build one small desktop app using:
NodeJS will be used for scanning local user hdd and inserting specific files that are found into SQLite3 database.
I checked dozens of documentation and suggestions. Most of them suggest to use NodeJS express framework and make layer between Angular 4+ -> Express -> SQLite3.
I want to avoid using express framework because it is going to be desktop app and it is not needed at all.
What I tried and what I did:
I installed:
"sqlite3": "^3.1.9",
"node-pre-gyp": "^0.6.36",
as dependencies in my project.
Than I have read if you want to use native nodejs library you should run electron rebuild. So I installed also electron rebuild:
"electron-rebuild": "^1.6.0"
as a devDependencies and run it with following command:
./node_modules/.bin/electron-rebuild
Rebuild sqlite3 successfully finished.
Than I run electron application and I get following error:
/~/node-pre-gyp/lib/node-pre-gyp.js
Module build failed: Error: ENOENT: no such file or directory, open '/home/haris/development/walter/angular-electron-starter/node_modules/node-pre-gyp/lib/node-pre-gyp.js'
at Error (native)
@ ./~/sqlite3/lib/sqlite3.js 1:13-36
@ ./src/app/home/home.component.ts
@ ./src/app/home/index.ts
@ ./src/app/app.module.ts
@ ./src/app/index.ts
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://localhost:3000 ./src/main.browser.ts
I stuck here. I tried many more things like:
1. Removing node_modules
2. npm install --build-from-source
but still I'm getting the same error.
Any suggestion or help will be very appreciated.
Node. js can be used very well with relational databases and SQLite is no exception.
I've just published a sample project which shows how to build a desktop app using Electron, Angular4 and Sqlite3. You can clone it here
Note I've node-gyp globally installed.
Hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With