Is requiring a node-gyp build necessary?
Hi Arvydas,
Installing blinkstick on Windows causes 'usb' to try build using node-gyp. Given blink-stick is designed for the more casual of coders, requiring old python, specific run-times and Visual Studio (as described here), seems a bit much for the novice?
I cannot install blink-stick on any of the three different Windows machines I've tried (varying development environments ranging from daily-dev to fresh-pc).
Node-hid (an alternative hid library) uses a module called node-pre-gyp to install pre-built binaries for specific platforms.
I was wondering what you thought of either of two options:
- Implementing node-pre-gyp inside of blinkstick-node for usb.
- Changing the USB-interop layer to use node-Hid? (I can help with this one).
Hope this causes no offence, simply trying to get your lovely implementation of blink-stick working cleaner on Windows :)
So, no joke, but I genuinely forgot about this, then returned a few years later to use the Blinkstick again and now three years later have returned with a fix!
Installing Blinkstick at the moment results in this bug in Windows 10.
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
sys.exit(gyp.script_main())
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line
545, in script_main
return main(sys.argv[1:])
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line
538, in main
return gyp_main(args)
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line
523, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2025, in GenerateOutput
version=msvs_version)
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 213, in __init__
self.Write()
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 340, in Write
f.close()
File "C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 397, in close
os.rename(self.tmp_path, filename)
WindowsError: [Error 183] Cannot create a file when that file already exists
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\User\\source\\repos\\build_light\\node_modules\\blinkstick\\node_modules\\usb\\src\\binding\\usb_bindings.node" "--module_name=usb_bindings" "--module_path=C:\\Users\\User\\source\\repos\\build_light\\node_modules\\blinkstick\\node_modules\\usb\\src\\binding" "--python=C:\\Users\\User\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
This bug can be fixed by using the latest usb and node-hid packages available. Pull-request following soon.