I'm using nodejs and node webkit for a windows app (node-webkit is now NWjs).
I installed the node-odbc
module and used the included tests to see if it works. Testing the database connection worked fine via the command line ("node aTestFile.js"), but the moment I try to call it from within index.html inside node-webkit, I receive the following error:
Uncaught node.js Error
Error: A dynamic link library (DLL) initialization routine failed.
c:\Users\SomeUser\Documents\Development\accessingDB\node_modules\odbc\build\Release\odbc_bindings.node
at Error (native)
And if I try to add the file as the node-main in the package.json, nothing happens.
I need a little help. What am I doing wrong?
as noted in the docs for NWjs (previously node-webkit), I found the following solution worked on Windows 10 when using an LTS release:
npm i -g windows-build-tools node-gyp
and be sure to enable showing file extensions in explorer (so the next step has file extension '.cc')win_delay_load_hook.cc
at pathC:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src
from GitHub sourcehttps://github.com/nwjs/nw.js/blob/nw18/tools/win_delay_load_hook.cc
npm install
for non-LTS releases or more help refer to the official docs: http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/