You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this excellent project. I've been using it a lot the past 6-8 to learn Electron+React.
I want to store a lot of data in the client, so I'm trying to add sqlite3 to the project. I'm trying to do what is done in electron-boilerplate-sqlite. I understand to some degree that in order to use sqlite3 with Electron, electron-builder must be used, which uses node-pre-gyp somehow to build the sqlite3 bindings.
First, I add sqlite3 to the project:
yarn add sqlite3
It appears that sqlite3 installs correctly. "sqlite3": "^3.1.8", is added to my package.json, but when the postinstall step runs (which critically includes the electron-builder install-app-deps command), I see the following errors:
[1] ERROR in ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js
[1] Module not found: Error: Can't resolve 'aws-sdk' in '/Users/ben/code/tesla/node_modules/sqlite3/node_modules/node-pre-gyp/lib'
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js 14:14-32
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib ^\.\/.*$
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
[1] @ ./node_modules/sqlite3/lib/sqlite3.js
[1] @ dll renderer
[1]
[1] ERROR in ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/publish.js
[1] Module not found: Error: Can't resolve 'aws-sdk' in '/Users/ben/code/tesla/node_modules/sqlite3/node_modules/node-pre-gyp/lib'
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/publish.js 17:14-32
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib ^\.\/.*$
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
[1] @ ./node_modules/sqlite3/lib/sqlite3.js
[1] @ dll renderer
[1]
[1] ERROR in ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/unpublish.js
[1] Module not found: Error: Can't resolve 'aws-sdk' in '/Users/ben/code/tesla/node_modules/sqlite3/node_modules/node-pre-gyp/lib'
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/unpublish.js 15:14-32
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib ^\.\/.*$
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
[1] @ ./node_modules/sqlite3/lib/sqlite3.js
[1] @ dll renderer
[1]
[1] ERROR in ./node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/rc/index.js
[1] Module parse failed: /Users/ben/code/tesla/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/rc/index.js Unexpected character '#' (1:0)
[1] You may need an appropriate loader to handle this file type.
[1] | #! /usr/bin/env node
[1] | var cc = require('./lib/utils')
[1] | var join = require('path').join
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js 11:13-26
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib ^\.\/.*$
[1] @ ./node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
[1] @ ./node_modules/sqlite3/lib/sqlite3.js
[1] @ dll renderer
[1] npm
[1] ERR! code ELIFECYCLE
[1] npm ERR! errno 2
[1] npm ERR! electron-react-boilerplate@0.12.0 build-dll: `cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js --colors`
[1] npm ERR! Exit status 2
[1] npm ERR!
[1] npm ERR! Failed at the electron-react-boilerplate@0.12.0 build-dll script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
If I isolate the the electron-builder step to it's own action...
and run npm run postinstall-electron-builder, electron-builder seems to run fine.
I think there is some incompatibility between Webpack, node-pre-gyp, concurrently, and/or sqlite3 that is keeping the postinstall step from running correctly. Maybe it is something related to webpack/webpack#4603, where a CLI tool is being bundled.
I'd appreciate any ideas or guidance you could offer in correctly getting sqlite3 working with this project. Thanks for your time.
The text was updated successfully, but these errors were encountered:
aguynamedben
changed the title
Error when adding sqlite3:
Error when adding sqlite3: You may need an appropriate loader to handle this file type.
Jul 28, 2017
@amilajack Thank you, I skipped over the part in the README about how the project has 2 different package.json files, sorry about that. I also didn't realize there were wiki docs too. Thanks so much for pointing me in the right direction.
Thanks for this excellent project. I've been using it a lot the past 6-8 to learn Electron+React.
I want to store a lot of data in the client, so I'm trying to add sqlite3 to the project. I'm trying to do what is done in electron-boilerplate-sqlite. I understand to some degree that in order to use sqlite3 with Electron, electron-builder must be used, which uses node-pre-gyp somehow to build the sqlite3 bindings.
First, I add sqlite3 to the project:
It appears that sqlite3 installs correctly.
"sqlite3": "^3.1.8",
is added to my package.json, but when the postinstall step runs (which critically includes theelectron-builder install-app-deps
command), I see the following errors:If I isolate the the electron-builder step to it's own action...
and run
npm run postinstall-electron-builder
, electron-builder seems to run fine.I think there is some incompatibility between Webpack, node-pre-gyp, concurrently, and/or sqlite3 that is keeping the postinstall step from running correctly. Maybe it is something related to webpack/webpack#4603, where a CLI tool is being bundled.
I'd appreciate any ideas or guidance you could offer in correctly getting sqlite3 working with this project. Thanks for your time.
The text was updated successfully, but these errors were encountered: