linux - 如何在ubuntu中安装npm install xbox-controller?

标签 linux node.js bash ubuntu

我使用 johnny- Five 来通过按钮使 LED 闪烁。我想用 xBox pad 的按钮让它闪烁,所以我找到了 npm xbox-controller,但我无法在 Ubuntu 14.04 中安装它。我收到此错误:

**compilation terminated.
make: *** [Release/obj.target/hidapi/hidapi/libusb/hid.o] Error 1
make: Leaving directory `/home/villalpando/xbox/node_modules/node-hid/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.16.0-37-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
gyp ERR! cwd /home/villalpando/xbox/node_modules/node-hid
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.16.0-37-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "node-hid"
npm ERR! node v0.10.38
npm ERR! npm  v2.9.0
npm ERR! code ELIFECYCLE
npm ERR! node-hid@0.3.2 install: `sh install.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-hid@0.3.2 install script 'sh install.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 install.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!     /home/villalpando/xbox/npm-debug.log**

还有其他方法吗?

最佳答案

我在这里找到了答案http://www.codeitive.com/0zzejPjkVg/npm-fail-to-install-nodehid-faild-to-install-last-version-of-nodejs.html看来我的node.js太旧了,无法支持node-hid,谢谢

关于linux - 如何在ubuntu中安装npm install xbox-controller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30061901/

相关文章:

javascript - 在 JavaScript 中扁平化 JSON 对象

node.js - 使用弹性 beantalk 部署复杂的 node.js 项目

python - 如何在 Linux 中使用不同的参数并行运行 python 脚本?

bash - 收到 SNMP 陷阱时如何执行脚本?

linux - 如何检查存储中是否存在本地不再存在的未跟踪/忽略文件? (混帐,Linux)

python - urllib3 段错误(核心已转储)

javascript - 如何使用ES6 super在子构造函数中调用父方法?

c - 如何在c中调整Linux应用程序中xterm的字体颜色

java - Apache tomcat - 如何在远程机器上打开浏览器

php - Bash 脚本 - 将 PHP INI 位置存储在变量中