Issues installing node.js API packages -

On trying to install

npm install -g blinkstick

It looks to fail when trying to install the usb required module. (I get a similar error if I try and install that module separately… So probably more of an issue with node-usb than node-blinkstick!)

Various errors such as

  • error C2011: ‘timespec’: ‘struct’ type redefinition (compiling source file …\libusb\libusb\io.c)

  • warning C4244: ‘=’: conversion from ‘time_t’ to ‘long’, possible loss of data

  • warning C4244: ‘=’: conversion from ‘__int64’ to ‘unsigned int’, possible loss of data

    gyp ERR! build error
    gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
    gyp ERR! stack at ChildProcess.onExit (C:\Users\Daxtra Tech Ltd\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
    gyp ERR! stack at emitTwo (events.js:87:13)
    gyp ERR! stack at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Windows_NT 10.0.10240
    gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\Daxtra Tech Ltd\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
    gyp ERR! cwd C:\Users\Daxtra Tech Ltd\AppData\Roaming\npm\node_modules\blinkstick\node_modules\usb
    gyp ERR! node -v v5.1.1
    gyp ERR! node-gyp -v v3.2.0
    gyp ERR! not ok
    npm WARN optional Skipping failed optional dependency /blinkstick/usb/usb-shyp-darwin-x64:
    npm WARN notsup Not compatible with your operating system or architecture: usb-shyp-darwin-x64@1.0.4
    npm ERR! Windows_NT 10.0.10240
    npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Users\Daxtra Tech Ltd\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “install” “-g” “blinkstick”
    npm ERR! node v5.1.1
    npm ERR! npm v3.5.1
    npm ERR! code ELIFECYCLE

    npm ERR! usb@1.0.4 install: node shyp-blacklist.js win32-x64 win32-ia32 darwin-x64 || node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the usb@1.0.4 install script ‘node shyp-blacklist.js win32-x64 win32-ia32 darwin-x64 || node-gyp rebuild’.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the usb package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! node shyp-blacklist.js win32-x64 win32-ia32 darwin-x64 || node-gyp rebuild
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR! npm bugs usb
    npm ERR! Or if that isn’t available, you can get their info via:
    npm ERR! npm owner ls usb
    npm ERR! There is likely additional logging output above.

OS is Windows 10 Pro. 10.0.10240

node.js process stuff

versions:
   { http_parser: '2.6.0',
     node: '5.1.1',
     v8: '4.6.85.31',
     uv: '1.7.5',
     zlib: '1.2.8',
     ares: '1.10.1-DEV',
     icu: '56.1',
     modules: '47',
     openssl: '1.0.2e' },
  arch: 'x64',
  platform: 'win32',

I suspect it must be some 32bit vs 64bit issue or similar that something is refusing to build on my system.

I managed to get it working. I installed node-hid and had to manually recompile it as per instructions on their site. Then I hacked the start of the main blinkstick.js so it was just

usb = require('node-hid')

Seems to work now with basic setting colours etc.

Thanks for reporting your solution. Will look into getting it working just by installing blinkstick package via npm.

Any word on getting this fixed via npm install blinkstick?