colinbdclark / osc.js

An Open Sound Control (OSC) library for JavaScript that works in both the browser and Node.js
GNU General Public License v2.0
778 stars 117 forks source link

Could not locate the bindings file. #85

Closed neeo closed 7 years ago

neeo commented 7 years ago

I am using NWJS for my desktop application. NWJS + osc.js works great on Linux and Mac, but on Windows, I get the following error message while loading my app (just by calling require("osc")).

Uncaught Error: Could not locate the bindings file. Tried: → D:\OSC_MON\node_modules\serialport\build\serialport.node → D:\OSC_MON\node_modules\serialport\build\Debug\serialport.node → D:\OSC_MON\node_modules\serialport\build\Release\serialport.node → D:\OSC_MON\node_modules\serialport\out\Debug\serialport.node → D:\OSC_MON\node_modules\serialport\Debug\serialport.node → D:\OSC_MON\node_modules\serialport\out\Release\serialport.node → D:\OSC_MON\node_modules\serialport\Release\serialport.node → D:\OSC_MON\node_modules\serialport\build\default\serialport.node → D:\OSC_MON\node_modules\serialport\compiled\7.7.3\win32\x64\serialport.node at bindings (D:\OSC_MON\node_modules\bindings\bindings.js:88:9) at Object. (D:\OSC_MON\node_modules\serialport\lib\bindings.js:3:35) at Module._compile (module.js:595:32) at Object.Module._extensions..js (module.js:610:10) at Module.load (module.js:512:32) at tryModuleLoad (module.js:471:12) at Function.Module._load (module.js:463:3) at Module.require (module.js:522:17) at require (internal/module.js:20:19) at Object. (D:\OSC_MON\node_modules\serialport\lib\serialport.js:12:25)

The file in question is located at D:\OSC_MON\node_modules\serialport\build\Release\serialport.node, but bindings.js can't locate it.

Any idea why?

Thanks!

System nodejs: 6.10.1 npm: 3.10.10 osc.js: 2.2.0 NWJS: 0.21.3 Windows 7 64-bit

jean-emmanuel commented 7 years ago

Node's native module serialport probably needs a rebuild to work with NWJS : http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/

If you don't need the serialport backend, this trick might also work for you: https://github.com/colinbdclark/osc.js/issues/69

neeo commented 7 years ago

Thanks for the tips! I actually solved it using this method: https://github.com/cotejp/serial-port-binaries-for-nwjs

I hope this will be useful for someone else out there having the same problem!

Thanks!

colinbdclark commented 7 years ago

Glad you were able to get it working, @neeo, and thanks for helping answer the question, @jean-emmanuel! I'm closing this issue because it sounds like you're all set. If you have further issues, please feel free to reopen this issue or file a new one.