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

Can't import module in electron 4.1.1 #214

Closed
MedAmineBenyettou opened this issue Jun 16, 2019 · 4 comments
Closed

Can't import module in electron 4.1.1 #214

MedAmineBenyettou opened this issue Jun 16, 2019 · 4 comments

Comments

@MedAmineBenyettou
Copy link

MedAmineBenyettou commented Jun 16, 2019

Am trying to use this module with electron v4.1.1 and node v10.16.0 but am getting this error :

  Node_modules\@serialport\bindings\build\Release\bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 64. This version of Node.js requires NODE_MODULE_VERSION 69.
@diegomachado1
Copy link

diegomachado1 commented Jun 16, 2019

Electron 4.1.1 requires Node 10.11.0.
You can use NVM to manage your node environment
Install the required version, delete your node_modules folder and rum npm install again

@MedAmineBenyettou
Copy link
Author

MedAmineBenyettou commented Jun 16, 2019

Well, I can't downgrade my electron + node for just 1 module, Am at the final stage of my project and I can't afford the time to do such a dangerous thing.

I never had such an error before and I think it's only related to the version of @serialport\bindings so maybe updating that file will help solve the probleme ?

Edit: I just used 10.11.0 and still , probleme not fixed.

@diegomachado1
Copy link

Ok, try this:

npm install electron-rebuild --save-dev

// execute the command this way:
./node_modules/.bin/electron-rebuild

// and then run your application like this:
./node_modules/.bin/electron .

And every time you add a new package, you'll need to run electron-rebuild

@MedAmineBenyettou
Copy link
Author

That's fixed the including probleme, but then when I do :

` const device = new escpos.USB();`

It just ... Crashes : no error no nothing, it just says that the DevTools was disconnected from this page.

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

3 participants