andrew / node-xbox-controller

:video_game: [UNMAINTAINED] Interface for Xbox 360 game controller into Node.js
http://libraries.io/npm/xbox-controller
MIT License
270 stars 50 forks source link

Cannot install #29

Closed starbug8866 closed 9 years ago

starbug8866 commented 9 years ago

Hi,

I'm pretty new to node.js but I want to use my xbox controller with my app. However, I hit the following issue when trying to install:

Registry url: https://registry.npmjs.org/ Current Time: 26/02/2015 11:29:05 AM Last Refreshed: 26/02/2015 8:27:25 AM Number of Results: 135668 ====Executing command 'npm install xbox-controller --save '====

npm WARN package.json NodejsConsoleApp2@0.0.0 No repository field.

node-hid@0.3.2 preinstall C:\Users\cslaviero\Documents\Visual Studio 2013\Projects\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\xbox-controller\node_modules\node-hid sh get-hidapi.sh 'sh' is not recognized as an internal or external command, operable program or batch file. npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "xbox-controller" "--save" npm ERR! node v0.12.0 npm ERR! npm v2.5.1 npm ERR! code ELIFECYCLE npm ERR! node-hid@0.3.2 preinstall: sh get-hidapi.sh npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-hid@0.3.2 preinstall script 'sh get-hidapi.sh'. npm ERR! This is most likely a problem with the node-hid package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! sh get-hidapi.sh npm ERR! You can get their info via: npm ERR! npm owner ls node-hid npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! C:\Users\cslaviero\Documents\Visual Studio 2013\Projects\NodejsConsoleApp2\NodejsConsoleApp2\npm-debug.log

====npm command completed with exit code 1====

Hopefully, it's something obvious I am doing wrong. I tried installing Cygwin to overcome the problem but that seemed to open up more issues.

Any help is greatly appreciated.

Thanks

bwin commented 9 years ago

Hi starbug, (edit: when commenting) you can wrap your console output in 3 backticks (```) to prevent it from being interpreted as markdown. The error states, that a linux shell is needed. So cygwin is the right path. You could also use the GitShell from GitHub for Windows. The package doesn't seem to work on node >= 0.11. Try with node 0.10, that works for me.

bwin commented 9 years ago

Since you wrote you're new to node, it might be nice to know there is a tool to switch node versions. https://github.com/coreybutler/nvm-windows

starbug8866 commented 9 years ago

Wow, thanks for the quick reply. I will give it go.

mapaiva commented 9 years ago

Hi @starbug8866
If you trying to install by npm install xbox-controller on windows like @bwin said you can use git shell to do this. But before this you need install Visual Studio 2013 (for windows 8 and 8.1) because xbox-controller uses node-hid that uses node-gyp to build the C++ addon.

These links can be usefl:

starbug8866 commented 9 years ago

Thanks mapaiva! That worked