0

I was importing a sqlite3 file with electron and come up with this problem

    App threw an error during load
    C:\projectSqlElectron\index.js:9
            filename: path.join(__dirname, 'database.sqlite')

    SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:815:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
at Module.load (internal/modules/cjs/loader.js:735:32)
at Module._load (internal/modules/cjs/loader.js:648:12)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at loadApplicationPackage (C:\projectSqlElectron\node_modules\electron\dist\resources\default_app.asar\main.js:109:16)
at Object.<anonymous> (C:\projectSqlElectron\node_modules\electron\dist\resources\default_app.asar\main.js:155:9)
at Module._compile (internal/modules/cjs/loader.js:880:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)...

aminography
  • 21,986
  • 13
  • 70
  • 74

1 Answers1

0

make sure it's the right path. or try path.join(__dirname, '/database.sqlite')

Joel
  • 81
  • 1
  • 7
  • I think its fixed now, the problem now is the npm run rebuild command 20 error code ELIFECYCLE 21 error errno 4294967295 22 error y@1.0.0 rebuild: `electron-rebuild -f -w sqlite3` 22 error Exit status 4294967295 23 error Failed at the y@1.0.0 rebuild script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 4294967295, true ] – Wryan Cartie Nov 25 '19 at 05:34
  • Looks like problem with native modules. try this solution https://stackoverflow.com/questions/32504307/how-to-use-sqlite3-module-with-electron – Joel Nov 25 '19 at 11:31