我使用此命令在我的机器上安装Appium
:
npm install -g appium
&安培;我收到了这个错误:
npm ERR! Error: EACCES, unlink '/usr/lib/node_modules/appium'
npm ERR! { [Error: EACCES, unlink '/usr/lib/node_modules/appium']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/appium' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-48-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "appium"
npm ERR! cwd /home/asus
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! path /usr/lib/node_modules/appium
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/lib/node_modules/appium'
npm ERR! error rolling back Error: EACCES, unlink '/usr/lib/node_modules/appium'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/lib/node_modules/appium']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/lib/node_modules/appium' }
npm ERR! not ok code 0
如何解决此问题?
答案 0 :(得分:1)
Linux中: •从http://www.oracle.com/technetwork/java/javase/downloads/index.html下载并安装最新的Java •从http://developer.android.com/sdk/index.html下载并安装最新的Android SDK •在.bash配置文件中配置ANDROID_HOME和JAVA_HOME的路径 •在.bash配置文件中配置Platform-tools and tools文件夹的路径 •使用命令gedit.bashrc打开bash配置文件
让appium在ubuntu pc上运行的步骤:
安装ruby:在终端粘贴以下命令,然后按Enter键
sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
Install linux brew:Paste the below command at terminal and hit enter
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
设置brew的路径
键入:终端的gedit.bashrc,然后将其粘贴到.bashrc文件中
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
安装节点:在终端上逐一粘贴以下命令,然后按Enter键
brew update
brew install node
brew link node
安装appium
npm install -g appium
npm install wd
启动appium:在终端粘贴以下命令并按Enter键
appium