jasongin / noble-uwp

Noble (Node.js Bluetooth LE) with Windows 10 UWP bindings
MIT License
83 stars 45 forks source link

Electron rebuild error #31

Closed itome closed 7 years ago

itome commented 7 years ago

I'm now trying on this module rebuild for electron. But some error occured when rebuiling or running modules. Any help would be greatly appreciated. Please see this issue too. -> #17

itome commented 7 years ago

I finally successfully rebuild the node-uwp by the npm way of rebuilding. See this issue -> https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md Also see this issue to build usb module in noble dependences -> https://github.com/sandeepmistry/noble/issues/235

erikkallen commented 7 years ago

For completeness I used this line to rebuild the modules for electron successfully

npm rebuild --runtime=electron --target=1.7.1 --arch=x64 --rebuild --disturl=https://atom.io/download/electron --build_from_source=true
jasongin commented 7 years ago

Thanks for the info. This should probably be added to the README to help other people trying to use this library with electron.

erikkallen commented 7 years ago

Added a pull request #32 so this issue can be closed

Janneman84 commented 7 years ago

The suggestion from itome works too, but since we're working in Windows beware to use 'set' instead of 'export' (or 'setx' to remember them between cmd sessions):

set npm_config_target=1.2.3 set npm_config_arch=x64 set npm_config_target_arch=x64 set npm_config_disturl=https://atom.io/download/electron set npm_config_runtime=electron set npm_config_build_from_source=true npm install