You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the package serialport in a project with no success. I have simplified the project to the following:
Created a new Bozon project with bozon new bozon-serialport-test.
Run bozon start to verify that the project works as expected.
To the top of app/renderer/application.js, added the line const Serialport = require('serialport);.
Doing this results in the following error.
application.js:2024 Uncaught Error: Could not locate the bindings file. Tried: → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/Debug/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/Release/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/out/Debug/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/Debug/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/out/Release/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/Release/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/default/serialport.node → /Users/john/Documents/Software_Development/Node/bozon_serialport_test/compiled/6.5.0/darwin/x64/serialport.node
The correct path is /Users/john/Documents/Software_Development/Node/bozon_serialport_test/builds/development/node_modules/serialport/build/Release/serialport.node.
As suggested here, I ran the (slightly modified) command ./app/node_modules/.bin/electron-rebuild (since the app node_modules dir is where serialport is). I get the same result.
Also from that page, I tried HOME=~/.electron-gyp node-gyp rebuild --target=1.4.15 --arch=x64 --dist-url=https://atom.io/download/electron and got the same result.
I also read through this post and tried the following:
Installed node-pre-gyp globally with yarn global node-pre-gyp.
In the directory . . .bozon_serialport_test/app/node_modules/serialport, I executed node-pre-gyp rebuild.
I ran the project again and got the same error.
I am using:
electron 1.4.15,
bozon 0.7.0,
OS X 10.11.6
What is generating those incorrect paths? Is there anything else to try to make this work?
The text was updated successfully, but these errors were encountered:
This appears to be a webpack issue. Because serialport is a binary file, it needs to be excluded from webpack. One solution for accomplishing this is adding an 'externals' property to the webpack configuration object in the file bozon/lib/building/tasks.js.
An even easier solution is changing the require statement ever so slightly:
WAS: const Serialport = require('serialport');
IS: const Serialport = window.require('serialport');
I am trying to use the package serialport in a project with no success. I have simplified the project to the following:
bozon new bozon-serialport-test
.bozon start
to verify that the project works as expected.const Serialport = require('serialport);
.Doing this results in the following error.
application.js:2024 Uncaught Error: Could not locate the bindings file. Tried:
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/Debug/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/Release/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/out/Debug/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/Debug/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/out/Release/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/Release/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/build/default/serialport.node
→ /Users/john/Documents/Software_Development/Node/bozon_serialport_test/compiled/6.5.0/darwin/x64/serialport.node
The correct path is
/Users/john/Documents/Software_Development/Node/bozon_serialport_test/builds/development/node_modules/serialport/build/Release/serialport.node
.As suggested here, I ran the (slightly modified) command
./app/node_modules/.bin/electron-rebuild
(since the app node_modules dir is where serialport is). I get the same result.Also from that page, I tried
HOME=~/.electron-gyp node-gyp rebuild --target=1.4.15 --arch=x64 --dist-url=https://atom.io/download/electron
and got the same result.I also read through this post and tried the following:
yarn global node-pre-gyp
.. . .bozon_serialport_test/app/node_modules/serialport
, I executednode-pre-gyp rebuild
.I am using:
electron 1.4.15,
bozon 0.7.0,
OS X 10.11.6
What is generating those incorrect paths? Is there anything else to try to make this work?
The text was updated successfully, but these errors were encountered: