# Cannot install appium on Android, Ubuntu stack

**URL:** <https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904>\
**Category:** Builds\
**Tags:** appium, script\
**Created:** [October 5, 2017, 8:33am UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904 "2017-10-05T08:33:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![han.tran](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/han.tran/32/927_2.png) [@han.tran](https://discuss.bitrise.io/u/han.tran)\
**Post date:** [October 5, 2017, 8:33am UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904/1 "2017-10-05T08:33:36Z")

</div>

# Cannot install appium on Android, Ubuntu stack.

## Description of the issue

Install appium with npm has errors.

```
+ npm install -g appium
/usr/bin/appium -> /usr/lib/node_modules/appium/build/lib/main.js
> appium-chromedriver@3.0.1 install /usr/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js
(node:658) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/201795-658-f7xl6k.ye8gd'
(node:658) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info Chromedriver Install Installing Chromedriver version '2.30' for platform 'linux' and architecture '64'
info Chromedriver Install Opening temp file to write chromedriver_linux64 to...
Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/appium/node_modules/appium-chromedriver/201795-658-yzkh96.6u41d'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/appium/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@3.0.1 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the appium-chromedriver@3.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-10-05T08_26_27_644Z-debug.log

```

## Environment:

**Where did the issue happen?**

Stack: Android & Docker Ubuntu 16.04

**Which build Step causes the issue and which version of the step?**

Script

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _If you have multiple different build configurations (workflows), does the issue affect all/more than one?_ : NO
- _If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds)_ : Always
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : From beginning

## Build log

[https://www.bitrise.io/build/253fc9081013d3c3](https://www.bitrise.io/build/253fc9081013d3c3)

---

<div class="post-metadata">

**Author:** ![gergelybekesi](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/gergelybekesi/32/1321_2.png) [@gergelybekesi](https://discuss.bitrise.io/u/gergelybekesi)\
**Post date:** [October 5, 2017, 12:42pm UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904/2 "2017-10-05T12:42:50Z")

</div>

Hey @han.tran

Could you please try local debugging? [Here](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392) is a Discuss How-to for this.

---

<div class="post-metadata">

**Author:** ![han.tran](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/han.tran/32/927_2.png) [@han.tran](https://discuss.bitrise.io/u/han.tran)\
**Post date:** [October 5, 2017, 1:05pm UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904/3 "2017-10-05T13:05:06Z")

</div>

Hi @gergelybekesi,

I did debug on with docker at my local, same errors.

---

<div class="post-metadata">

**Author:** ![han.tran](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/han.tran/32/927_2.png) [@han.tran](https://discuss.bitrise.io/u/han.tran)\
**Post date:** [October 5, 2017, 1:21pm UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904/4 "2017-10-05T13:21:44Z")

</div>

What I can try at local now is:

- Pull docker and run
- Remove nodejs by apt-get
- Create new user and use that user to install linuxbrew
- Install Node again
- Install Appium

=\> BUT all on the new user role, not a solution!  
=\> There are some problems with pre-installed node on the image.

---

<div class="post-metadata">

**Author:** ![han.tran](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/han.tran/32/927_2.png) [@han.tran](https://discuss.bitrise.io/u/han.tran)\
**Post date:** [October 6, 2017, 11:09am UTC](https://discuss.bitrise.io/t/cannot-install-appium-on-android-ubuntu-stack/2904/5 "2017-10-06T11:09:25Z")

</div>

Looks like it’s a bug of npm . [https://github.com/appium/appium/issues/7525#issuecomment-266800539](https://github.com/appium/appium/issues/7525#issuecomment-266800539)

I did switch back to older version of npm and able to install appium on android-docker.

```
npm uninstall -g appium
npm install -g npm@4.0.5
npm install -g appium
```
