sandeepmistry / node-sensortag

Node.js lib for the TI SensorTag
MIT License
218 stars 111 forks source link

Electron and nw.js support #108

Closed chipimix closed 6 years ago

chipimix commented 6 years ago

Hi!

I am trying to build a windows executable which graphically displays sensortag data. With this module, I can easily communicate with my SensorTag. Unfortunately, I am having issues with the GUI! I have tried two frameworks: NW.js & Electron.

However, upon page inspection I get a similar error:

nwjs:

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\chipimix\helloNWJS\node_modules\usb\src\binding\usb_bindings.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:760:18)
    at Module.load (internal/modules/cjs/loader.js:623:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:562:12)
    at Function.Module._load (internal/modules/cjs/loader.js:554:3)
    at Module.require (internal/modules/cjs/loader.js:661:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Users\chipimix\helloNWJS\node_modules\usb\usb.js:5:38)
    at Module._compile (internal/modules/cjs/loader.js:713:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:730:10)
    at Module.load (internal/modules/cjs/loader.js:623:32)

electron:

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\chipimix\electronSensorTag1\node_modules\usb\src\binding\usb_bindings.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)
    at Object.Module._extensions..node (module.js:671:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (module.js:586:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\chipimix\electronSensorTag1\node_modules\usb\usb.js:5:38)
    at Object.<anonymous> (C:\Users\chipimix\electronSensorTag1\node_modules\usb\usb.js:417:3)

Any idea what am I doing wrong? Thanks!

chipimix commented 6 years ago

I ran ./node_modules/.bin/electron-rebuild.cmd as advised here in my project directory and now the DLL error is gone!