Open bawasaab opened 6 years ago
What is the node.js version?
Nodejs version v8.10.0
am using angular 5.2.0
would u please suggest me a tutorial to how to connect sqlite-sync with angular 2+
am trying to create a web app using angular 5 and sqlite-sync
is it possible to get sqlite object like the syntax below instead of var sqlite = require('sqlite-sync'); import { sqlite3 } from 'sqlite-sync'
ERROR TypeError: fs.existsSync is not a function Stack trace: sqlite.prototype.connect@webpack-internal:///./node_modules/sqlite-sync/sqlite.js:61:14 ConnectionService.prototype.connect@webpack-internal:///./src/app/services/connection.service.ts:28:9 ConnectionService@webpack-internal:///./src/app/services/connection.service.ts:22:9 UsersService@webpack-internal:///./src/app/services/users.service.ts:16:21 _createClass@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11147:20 _createProviderInstance$1@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11123:26 resolveNgModuleDep@webpack-internal:///./nodemodules/@angular/core/esm5/core.js:11108:17 NgModuleRef.prototype.get@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12345:16 resolveDep@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12835:12 createClass@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12697:29 createDirectiveInstance@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12542:37 createViewNodes@webpack-internal:///./node_modules/@angular/core/esm5/core.js:14000:53 createRootView@webpack-internal:///./node_modules/@angular/core/esm5/core.js:13889:5 callWithDebugContext@webpack-internal:///./node_modules/@angular/core/esm5/core.js:15314:39 debugCreateRootView@webpack-internal:///./nodemodules/@angular/core/esm5/core.js:14597:12 ComponentFactory.prototype.create@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11494:37 ComponentFactoryBoundToModule.prototype.create@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4246:16 ApplicationRef.prototype.bootstrap@webpack-internal:///./node_modules/@angular/core/esm5/core.js:6081:40 PlatformRef.prototype._moduleDoBootstrap/<@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5808:74 PlatformRef.prototype._moduleDoBootstrap@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5808:13 PlatformRef.prototype.bootstrapModuleFactory/</</<@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5729:21 ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:388:17 onInvoke@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4976:24 ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:387:17 Zone.prototype.run@webpack-internal:///./node_modules/zone.js/dist/zone.js:138:24 scheduleResolveOrReject/<@webpack-internal:///./node_modules/zone.js/dist/zone.js:872:29 ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:421:17 onInvokeTask@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4967:24 ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:420:17 Zone.prototype.runTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:188:28 drainMicroTaskQueue@webpack-internal:///./node_modules/zone.js/dist/zone.js:595:25 AppModule:1 ERROR CONTEXT Object { view: {…}, nodeIndex: 1, nodeDef: {…}, elDef: {…}, elView: {…} } AppModule:1 TypeError: fs.existsSync is not a function Stack trace: sqlite.prototype.connect@webpack-internal:///./node_modules/sqlite-sync/sqlite.js:61:14 ConnectionService.prototype.connect@webpack-internal:///./src/app/services/connection.service.ts:28:9 ConnectionService@webpack-internal:///./src/app/services/connection.service.ts:22:9 UsersService@webpack-internal:///./src/app/services/users.service.ts:16:21 _createClass@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11147:20 _createProviderInstance$1@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11123:26 resolveNgModuleDep@webpack-internal:///./nodemodules/@angular/core/esm5/core.js:11108:17 NgModuleRef.prototype.get@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12345:16 resolveDep@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12835:12 createClass@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12697:29 createDirectiveInstance@webpack-internal:///./node_modules/@angular/core/esm5/core.js:12542:37 createViewNodes@webpack-internal:///./node_modules/@angular/core/esm5/core.js:14000:53 createRootView@webpack-internal:///./node_modules/@angular/core/esm5/core.js:13889:5 callWithDebugContext@webpack-internal:///./node_modules/@angular/core/esm5/core.js:15314:39 debugCreateRootView@webpack-internal:///./nodemodules/@angular/core/esm5/core.js:14597:12 ComponentFactory.prototype.create@webpack-internal:///./node_modules/@angular/core/esm5/core.js:11494:37 ComponentFactoryBoundToModule.prototype.create@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4246:16 ApplicationRef.prototype.bootstrap@webpack-internal:///./node_modules/@angular/core/esm5/core.js:6081:40 PlatformRef.prototype._moduleDoBootstrap/<@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5808:74 PlatformRef.prototype._moduleDoBootstrap@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5808:13 PlatformRef.prototype.bootstrapModuleFactory/</</<@webpack-internal:///./node_modules/@angular/core/esm5/core.js:5729:21 ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:388:17 onInvoke@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4976:24 ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:387:17 Zone.prototype.run@webpack-internal:///./node_modules/zone.js/dist/zone.js:138:24 scheduleResolveOrReject/<@webpack-internal:///./node_modules/zone.js/dist/zone.js:872:29 ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:421:17 onInvokeTask@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4967:24 ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:420:17 Zone.prototype.runTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:188:28 drainMicroTaskQueue@webpack-internal:///./node_modules/zone.js/dist/zone.js:595:25 main.ts:12:16 TypeError: asm.js type error: unsupported expression