系统环境

OS: centos6.5
JDK: 1.7

已安装依赖

gcc python openssl
-----------其为安装 nodejs 的环境

已成功安装

nodejs : v0.10.40
NPM : v 1.4.28

安装后的问题

bufferutil@1.1.0 install /usr/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at errnoException (net.js:905:11)
gyp ERR! stack at TCP.onread (net.js:559:19)
gyp ERR! System Linux 2.6.32-431.23.3.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.40","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.40","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.40","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.40","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.40","npm":"1.4.28"})
npm WARN optional dep failed, continuing bufferutil@1.1.0

疑问

1.APPIUM 通过 npm 安装时,要求不能用 sudo 执行;但是 nodejs 安装却又必须 root。--此为冲突疑问点
2.同时,根据错误信息,可以见到些明显的错误(比如原因可能是文件根本不存在),而且 root 都无权限创建,这超出我个人知识的理解范畴。

求助

哪位有在 linux(centos/redhat)成功安装了,还请详细指引下,不胜感激!


↙↙↙阅读原文可查看相关链接,并与作者交流