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

Incompatibility with node-serialport (bindings.node initialization failed) #3696

Closed
kfatehi opened this issue Feb 16, 2019 · 7 comments
Closed

Comments

@kfatehi
Copy link

kfatehi commented Feb 16, 2019

  • Version: 20.38.5

  • Target: Windows

  • @serialport/bindings version v2.0.7

I'm using proton-native, which integrates with electron-builder, and initially filed an issue there, but the author said to file an issue here instead.

Please see the issue kusti8/proton-native#196 for screenshots of the error.

There is an example project here: https://github.com/kfatehi/proton-native-serialport-issue

After npm install just run npm run dist to create the broken exe reproducing the error.

I also cross-posted in a comment on node-serialport and got a response indicating that serialport project plans to switch to N-API in April, which may be the proper solution to this issue.

@kfatehi kfatehi changed the title Incompatibility with node-serialport(bindings.node initialization failed) Incompatibility with node-serialport (bindings.node initialization failed) Feb 16, 2019
@yrik
Copy link

yrik commented Mar 9, 2019

Think I have similar issue #3736

@stale stale bot added the backlog label Jul 1, 2019
@s00500
Copy link

s00500 commented Jul 8, 2019

Uff I have the same issue...

I am on macOS though and I used the vue-cli plugin to start

@stale stale bot removed the backlog label Jul 8, 2019
@develar
Copy link
Member

develar commented Jul 8, 2019

Please try 21.0.11

@develar develar closed this as completed Jul 8, 2019
@electron-userland electron-userland deleted a comment from stale bot Jul 8, 2019
@s00500
Copy link

s00500 commented Jul 8, 2019

Thanks for the quick reply, I was using vue-cli-plugin-electron-builder, the solution in my case was to mark serialport as external for the builder

// vue.config.js
module.exports = {
  pluginOptions: {
    electronBuilder: {
      externals: ['serialport']
    }
  }
}

@zugende
Copy link

zugende commented Jul 10, 2019

Hi @s00500, I encounter the same problem as you but when I apply your vue.config.js I get the following error:

App threw an error during load Error: The module '\\?\C:\Users\Admin\projects\serial_test\node_modules\@serialport\bindings\build\Release\bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 47. This version of Node.js requires NODE_MODULE_VERSION 70. Please try re-compiling or re-installing the module (for instance, using npm rebuildornpm install). at process.func [as dlopen] (electron/js2c/asar.js:155:31) at Object.Module._extensions..node (internal/modules/cjs/loader.js:857:18) at Object.func [as .node] (electron/js2c/asar.js:155:31) at Module.load (internal/modules/cjs/loader.js:677:32) at tryModuleLoad (internal/modules/cjs/loader.js:609:12) at Function.Module._load (internal/modules/cjs/loader.js:601:3) at Module.require (internal/modules/cjs/loader.js:715:19) at require (internal/modules/cjs/helpers.js:14:16) at bindings (C:\Users\Admin\projects\serial_test\node_modules\bindings\bindings.js:112:48) at Object.<anonymous> (C:\Users\Admin\projects\serial_test\node_modules\@serialport\bindings\lib\win32.js:1:36) Done in 15.56s.

As I understood electron-builder will handle all the rebuilding for electron. Do you or somebody else know the answer to this error?

@s00500
Copy link

s00500 commented Jul 10, 2019

install electron-rebuild and run npx electron-rebuild -f -p

@mussacharles60
Copy link

install electron-rebuild and run npx electron-rebuild -f -p

Thanks, it works :)

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

6 participants