-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron + Webpack + React: SQLite package has not been found installed #2456
Comments
This my help, maybe it won't...
I may be doing this all wrong but TypeORM seems to make assumptions about where things are supposed to be installed (near the package.json file, lol) and this was the only way I could get it to work. |
Thanks for your solution @HyperSprite, maybe that's a little complicated. I'm still waiting for @pleerock , maybe he has a better solution for this issue. |
There is a
make sure to do exact instructions, also use npm instead of yarn just to be sure that its not related to yarn somehow. Usually problem can be with native module built by sqlite make sure its there (post-install script does it) and its built for electron. |
I removed and reinstall all the packages using This is what error I've got after console.log from SqliteDriver source code. Cannot find module 'C:\Users\Romsy\Documents\Code\Projects\savings\node_modules\sqlite3\lib\binding\electron-v1.8-win32-x64\node_sqlite3.node'
at Module._resolveFilename I think it's related to electron/electron#10220 |
I finally fixed my issue by installing this package https://github.com/electron/electron-rebuild, and run electron-rebuild -f -w sqlite3 Thanks, everyone 🙂 |
Maybe this one needs to be added to the docs since a lot of windows users like me getting the same issue. |
there is actually a post-install script in package.json that runs electron-rebuild for you |
I have same issue. I have tried using electron-rebuild, but no luck. |
I know this is old and closed but just want to add a note about my final solution with Electron. Not sure it will work in this case but thought I'd add this anyway. The real problem for me was the Electron React Boilerplate (ERB) was using a 2 package.json file system and even though I was able to get things to work initially, it was whack-a-mole with other issues. I ended up collapsing ERB into a single package.json repo (I filed a PR back to ERB last year, it might finally be in their .next branch now, not sure, my project is no longer tracking to that). The single package.json system makes the electron-builder work as expected without any extra config or messing around. |
I ran into the same problem (Electron + Create React App / Webpack). |
It's working on 0.2.13, on newer version it's not working and show error like in issue. Try to downgrade typeorm dependency to this version. |
For my the fix was to change install script from:
to
|
Just a follow up for recent versions. add sqlite3 to the dependencies of the pass manually the driver (typeorm is doing a relative path resolution)
No errors anymore |
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[x]
sqlite
[ ]
sqljs
[ ]
react-native
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
I using this boilerplate to make my electron app. https://github.com/iRath96/electron-react-typescript-boilerplate
I follow the same instruction as https://github.com/typeorm/electron-typescript-example did, but when I run
yarn dev
on my project it throws an error like below on console developer tools electron app.I have removed and reinstall node_modules but it didn't work.
I also double check if
sqlite3
present on node_modules or not. But it's available.So I've made repository if you want to check it out, here is my repo https://github.com/rohmanhm/ts-electron-react-typeorm-sqlite
Any way to solve this issue? Any suggestion will be helpful.
The text was updated successfully, but these errors were encountered: