leota / electron-angular4-sqlite3 Goto Github PK
View Code? Open in Web Editor NEWSample project to show how to build a desktop app using Electron, Angular 4 and Sqlite3
Sample project to show how to build a desktop app using Electron, Angular 4 and Sqlite3
npm i on Windows and Linux results in
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
When I run npm run electron-rebuild
I get the error
npm ERR! missing script: electron-rebuild
There is any way to build this project with watch enabled? I've tried to add the flag "--watch" and "-w" to the "build-electron" script, but it doesn't open the electron app.
Hi,
I am new with electron and knex platform.
I am using the same git repository.
All commands are running successfully. (Using window 10 platform)
But I am not getting any user list.
Q : I have to add user in sql or users list already present ???
If present then list is not coming.
if not then how to add the user list using app.component.ts file.
Hi,
I was looking for similar setup and come across your project. I hope you don't mind.
I am encountering an error running "npm run electron-win ". I not quite sure why knex throwing out error.
App threw an error during load
D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\migrate\Migrator.js:43
...knex.userParams,
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\util\make-knex.js:3:22)
at Object. (D:\electron-sample\electron-angular4-sqlite3-master\node_modules\knex\src\util\make-knex.js:284:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
Thanks for the help.
HI @tonydiep ,
I am trying to package this application for win-32 ia-32 processor, it packaging successfully but while i am trying to click on exe i am getting
" Can't Find module node_sqlite3.node"
Please help me regarding this.
I am using this sample code and got success with local database things.
But my issue is when i am trying to make package for mac it is showing error.
I am using electron-packager. I am attaching the screen shot of app when we are running angular-electron-sqlite.app file.
So can any one suggest how we can make it as package file
Build fails because node-sass is missing from package.json
fix by
npm i node-sass --save-dev
Is there any method to use sqlite3 or ORM directly in Angular Framework of the renderer process in Electron, not main process? Because the renderer process can understand Node'js APIs, I think it could be possible.
You can refer this issue typeorm/typeorm#121.
Thank you.
It saying
knex
run
npm install --save sqlite3
There is any way to use SQL query statements instead of the knex methods?
hi, @leota . I cloned your repo and run in local, but failed in npm run rebuild. could you tell me your npm version and python version and so on? thanks
When i type on terminal npm run electron
i have this error:
Knex: run
$ npm install sqlite3 --save
Error: Cannot find module '/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Object.<anonymous> (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/sqlite3/lib/sqlite3.js:190:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Client_SQLite3._driver (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/knex/lib/dialects/sqlite3/index.js:75:12)
at Client_SQLite3.initializeDriver (/Users/vitolipari/job/LipariStudios/app/ElectronAngular4SQLite3_Sample/node_modules/knex/lib/client.js:219:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] electron: `npm run build-electron && electron dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] electron script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/vitolipari/.npm/_logs/2017-12-08T13_44_45_983Z-debug.log
at first, I followed as given instruction to start electron app but during npm install electron was failing to install.
then I removed the electron from package.json and manually installed electron with the latest version.
now I am getting an error saying that require is not defined in index.html file at line 15
Uncaught ReferenceError: require is not defined at index.html:15
and another error is cannot read property ipcRenderer of undefined in AppComponent
AppComponent_Host.html:1 ERROR TypeError: Cannot read property 'ipcRenderer' of undefined
Cloning a fresh copy of the repo and running the commands in README fails at npm run electron with
A JavaScript error occurred in the main process
Uncaught Exception:
/mnt/usb-1t/projects/electron-angular4-sqlite3/node_modules/knex/lib/client.js:292
...this.getPoolSettings(config.pool),
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/mnt/usb-1t/projects/electron-angular4-sqlite3/node_modules/knex/lib/knex.js:2:16)
Hi. I would like to say thank you as I was trying to integrate sqlite + angular and electron for a few days and without success.
I'm not sure if this is an issue as you would find it already or rather this is because I'm new with angular :) . So please excuse me that I'm writing to you in such way.
I have just downloaded clear version of your project to see how to use the sqlite with standalone electron app. I wanted to test it from the browser so just stared it as usual Angular application with ng server
and then I'm I'm getting following error from index.html
Uncaught ReferenceError: require is not defined
at localhost/:14
btw. I have no error when running like you advised 'npm run electron'
Also could kindly please advise me how to make it working for inserting the data into the DB ? I mean, how to send any arguments from controller ?
Regards
Jan
have a sqlite implemented for mobile app.wants to resuse it in my electron angular app,i was able to get the sqliteservice package in app.component.ts. but stuck in providing path to db,,,
i tried like this..
this.db = window
.sqlitePlugin
.openDatabase({name: 'database.sqlite', location: ''../DB/''});
and this way:
this.db = {name: 'database.sqlite', location: '../DB/'};
ant help would be appreciated..
Hello,
Your work helped me get started with my project, thank you.
I'm trying to execute queries outside the main.js of the electron folder, but I can't get it to work. I need to write a typescript file with all the functions needed to access the database.
could you please help me.
I keep getting Unhandled rejection TypeError: _this.driver.Database is not a constructor at ...
in the console of the electron app
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.