Appium 求助:如何在 linux 中安装 APPIUM

32191163 · 2015年11月20日 · 最后由 32191163 回复于 2015年12月02日 · 1367 次阅读

系统环境

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)成功安装了,还请详细指引下,不胜感激!

共收到 15 条回复 时间 点赞

brew install node # get node.js
npm install -g appium # get appium
npm install wd # get appium client
appium & # start appium
node your-appium-test.js

#1 楼 @tspring 官网已经很熟悉了 在 get appium 的时候报错的

#2 楼 @32191163

疑问的第一点:
我记得当时我的做法是直接将 nodejs 的安装的路径改成 chmod 777 之后 就可以解压安装了,这样子就不会跟 npm install appium 冲突了,虽然这个做法有点恶心。

安装 node 的时候记得用 sudo

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"

你去找找你/root/.node-gyp/的权限是不是可读可写。。
如果不存在就找 /root 的权限。。

如果使用 brew link node 提示权限不足,就进入到 admin 用户下,使用 su 进入
1) 提升 node 的权限
sudo chown -R root:admin /usr/local;
sudo chmod g+w /usr/local

#5 楼 @lylyliuyu 我查这个文件在/root 下是没有的

#6 楼 @keen_lau 没有用 brew 去安装 我是直接安装了 nodejs 和 NPM http://nodejs.cn/download/package-manager/#enterprise-linux-and-fedora

#5 楼 @lylyliuyu 我就是 root 登录的

#7 楼 @32191163 那就是你 root 文件夹的权限不够咯

#3 楼 @zsx10110 嗯,赋权应该是解决了我第一个疑问了。不过昨天独立安装 nodejs 出现底层依赖问题,最后是用命令安装成功。但又在安装 appium 时,出现以上的错误

#4 楼 @anikikun 我是 root 用户,这个不影响

求助,npm install -g appium --save-dev
--sudo apt-get install git
--sudo chown -R yourusername ~/.npm
时,没反应,听说要用国内的镜像源?

#13 楼 @louisheb npm -g --registry http://registry.cnpmjs.org install appium 用这个命令试试

#10 楼 @lylyliuyu no. 权限问题都能解决
现在这个环境没有了 ,过段时间有空再部署

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册