Skip to content
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

node-odbc incompatible with Electron? #107

Open
ghost opened this issue Aug 4, 2016 · 3 comments
Open

node-odbc incompatible with Electron? #107

ghost opened this issue Aug 4, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 4, 2016

Hello, I have question. node-odbc incompatible with Electron?

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\acterhd\Downloads\aeroflot\node_modules\odbc\build\Release\odbc_bindings.node
@ghost ghost changed the title odbc incompatible with Electron? node-odbc incompatible with Electron? Aug 4, 2016
@wankdanker
Copy link
Collaborator

Hello! I helped someone with Electron in the past and the issue was that internally Electron was using a version of Node.js that was different from the version of Node.js that was used to build/install the odbc module.

I'd suggest that you make sure the version of Node.js you have installed on your system matches the version that is used in Electron. You may need to run console.log(process.version) in your Electron app and node --version from the command line to see where things stand.

I hope this helps.

@wankdanker
Copy link
Collaborator

See also: #100 (comment)

@joshuapinter
Copy link

joshuapinter commented Aug 29, 2017

Depending on what you're doing, you can use electron-rebuild to rebuild odbc to the version of electron you have installed.

To do so:

npm install --save-dev electron-rebuild

$(npm bin)/electron-rebuild                 # Mac and Linux.

.\node_modules\.bin\electron-rebuild.cmd    # Windows.

Because I kept forgetting to do this after doing an npm install (and to help others that downloaded the project), I added the following two scripts to package.json:

"scripts": {
  "start": "electron .",
    
  "postinstall": "electron-rebuild",    
  "electron-rebuild": "electron-rebuild"
},

The postinstall will automatically run after doing a npm install so after the typical install finishes you'll see a console log message with electron-rebuild and it will automatically rebuild odbc and any other native library you have to the electron version. This means that you shouldn't even have to think about running electron-rebuild going forward. 👍

To manually re-run electron-rebuild just run it with npm run electron-rebuild.

Easy-peezie, lemon-squeezie!

clach04 pushed a commit to clach04/node-odbc__DO_NOT_USE that referenced this issue Dec 17, 2020
Update binding.gyp to build Windows with UNICODE defined by default

Signed-off-by: Mark Irish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants