Electron 1.2.x SQLite3 not working on windows (DLL related issue)
Hi, I already spent 3 days trying to fix this problem, the SQLIte3 module works fine in Linux and Darwin, but in windows x64 it is launching the following error:
A dynamic link library (DLL) initialization routine failed. node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node
I tried rebuilding the module targeting electron 1.2.7 with this commands:
npm run prepublish
node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.2-win32-x64
node-gyp rebuild --target=1.2.7 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.2-win32-x64
But it fails throwing a lot of erros and warnings about deprecated stuff, if I change the target to electron v. 0.37.0 then it compiles correctly but I get the same DLL error and I have no idea why is it happening.
Had anyone any luck when trying to use the SQLIte module in windows with the latests electron versions? All I have found is just rebuild instructions using always the 0.x.x versions.
I'm trying to run this on:
- Windows 10 x64
- Node 6.3.0
- NPM 3.10.3
- Electron 1.2.7
Thanks in advance.
Hi, I faced the rebuilding issue and fixed in my environment.
- Windows 7 x64
- node 4.4.1
- npm 2.1.4.20
- Electron 1.3.1
A dynamic link library (DLL) initialization routine failed. node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node
I assume the path above is a part of the DLL error message. Is the path actually exists on your file system? If not, it obviously fails.
It will be helpful that you provide the error messages.
I hope this helps.
Can't use Node 6.x @CheckMater - I found this out the extremely hard way. This whole build process really needs fixing on Windows. Some prebuilt binaries here would go a LONG way for this project.
The only successful combination that's worked for me:
node 4.4.xnpm 2.x.ypython 2.7visual studio 2013 express(didn't work for me invs2015)- set environment variable
GYP_MSYS_VERSION=2013 - launch the
Developer Command Prompt for VS2013shortcut asAdministrator
npm run prepublish
node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64
node-gyp rebuild --target=1.3.0 --target_arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64 --runtime=electron`
Is doing this:
npm run prepublish node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64 node-gyp rebuild --target=1.3.0 --target_arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64 --runtime=electron`
Is the same as using electron-rebuild
.\node_modules.bin\electron-rebuild.cmd
?
@erikyuzwa Did you manage to get SQLite to work after rebuilding ?
Is the same as using electron-rebuild .\node_modules.bin\electron-rebuild.cmd
@CheckMater I don't know. I had no idea that existed. I'd say go for it and see what happens.
Mine rebuilds SQLite3 and works for me every time now, so I'm leaving it. :+1: