I was very exited to install appium but one major issue I encountered is that you can't npm-install it using sudo.
Well that's really annoying because I'm installing it on a VM that has a shared folder, and I have to use sudo... damn...
So I tired several solutions, and found that the best thing to do, is install nodejs and npm allover again using Homebrew.
I thought it's a good place to share the process I went through:
Note that I'm running Ubuntu 13.04 64bit Using VirtualBox.
This solution worked for me, but I hope that will help someone, someday.
- Uninstall node and npm:
sudo apt-get remove nodejs
- install linuxbrew:
ruby -e "$(wget -O- https://raw.github.com/Homebrew/linuxbrew/go/install)"
- Add linuxbrew to path:
In many places you might see that you need to add the following lines to .bashrc
In my case, .bashrc is not loaded each time I open the terminal, instead .bash_profile was the right place.
export PATH="$HOME/.linuxbrew/bin:$PATH" export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"
so just add these two lines to the file that fits your machine.
- Install nodejs and npm:
brew install node
- Existing global packages.
If you have already installed global packages, make sure they will be in the newly created global packages folder. Since I didn't have many, I just reinstalled them. Default folder is:
old one was:
- Install appium globally:
npm install -g appium
- Install appium client in your project folder:
npm install wd
Download and Install Android SDK:
- Download from: http://developer.android.com/index.html
- unzip the downloaded file. I put it under the $HOME path and named the folder
Add the following paths to .bashrc / .bash_profile:
- Install needed packages:
Add AVD (Andorid virtual device)
- Go to "Device Definitions"
- Click on the wanted device.
- Click create AVD.
- Go to Android Virtual Devices.
- Click Start.
Start appium server:
- Run tests: