Error with Electron + Serialport to use Arduino

Asked

Viewed 308 times

2

I’m having trouble running an application made with Electron, Serialport and Node.Js to communicate with an Arduino.

I have the following mistake:

App threw an error during load
Error: Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou.
\\?\c:\teste\node_modules\serialport\build\Release\serialport.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at bindings (c:\teste\node_modules\bindings\bindings.js:76:44)
    at Object.<anonymous> (c:\teste\node_modules\serialport\lib\bindings.js:3:35)

I’ve tried several solutions but none worked so far, someone has gone through it or knows another library better to use with Arduino and Electron?

2 answers

1


I solved the error by adding in the file package json. the following excerpt: "install": "Electron-rebuild". Follows part of the code for future queries:

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

1

This is caused because the module does not come with the required files compiled by default...

Delete files from folder node_modules/serialport/build/Release

Then run the following command in the same directory as package.json

npm rebuild --runtime=electron --target=1.6.11 --arch=x64 --dist-url=https://atom.io/download/atom-shell

If you are using another version of Electron, just change the --target

  • Thank you for your reply. Unfortunately you have not solved the error.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.