# Appium npm install failed with gyp error

**URL:** <https://discuss.appium.io/t/appium-npm-install-failed-with-gyp-error/7228>\
**Category:** Support\
**Created:** [November 24, 2015, 9:32am UTC](https://discuss.appium.io/t/appium-npm-install-failed-with-gyp-error/7228 "2015-11-24T09:32:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jellybeans](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/eada6e/32.png) [@jellybeans](https://discuss.appium.io/u/jellybeans)\
**Post date:** [November 24, 2015, 9:32am UTC](https://discuss.appium.io/t/appium-npm-install-failed-with-gyp-error/7228/1 "2015-11-24T09:32:19Z")

</div>

Tried to install appium server using the following command:  
npm install -g appium

MacOS: OS X El Capitan 10.11.1  
npm version: 3.3.12  
node version: v5.1.0

bash\_profile path settings:  
export PATH=$HOME/local/bin:$PATH  
export JAVA\_HOME=$(/usr/libexec/java\_home -v 1.7)  
export M2\_HOME=/Users//Documents/Programs/apache-maven-3.3.3  
export PATH=${M2\_HOME}/bin:${PATH}  
export NODE\_PATH=’/usr/local/lib/node\_modules’  
export PATH="/usr/local/bin:/usr/local/Cellar/node/5.1.0/bin:$PATH"  
export PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin

Getting the following error while trying to install appium:  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node\_modules/npm/node\_modules/node-gyp/lib/build.js:270:23)  
gyp ERR! stack at emitTwo (events.js:87:13)  
gyp ERR! stack at ChildProcess.emit (events.js:172:7)  
gyp ERR! stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:200:12)  
gyp ERR! System Darwin 15.0.0  
gyp ERR! command “/usr/local/Cellar/node/5.1.0/bin/node” “/usr/local/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js” “rebuild”  
gyp ERR! cwd /Users/Bindu/.node/lib/node\_modules/appium/node\_modules/ws/node\_modules/utf-8-validate  
gyp ERR! node -v v5.1.0  
gyp ERR! node-gyp -v v3.0.3  
gyp ERR! not ok  
npm WARN install:utf-8-validate@1.1.0 utf-8-validate@1.1.0 install: `node-gyp rebuild`  
npm WARN install:utf-8-validate@1.1.0 Exit status 1  
/Users//.node/lib  
└── appium@1.4.13

---

<div class="post-metadata">

**Author:** ![shermaneric](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@shermaneric](https://discuss.appium.io/u/shermaneric)\
**Post date:** [November 28, 2015, 8:37pm UTC](https://discuss.appium.io/t/appium-npm-install-failed-with-gyp-error/7228/2 "2015-11-28T20:37:24Z")

</div>

Make sure Xcode 7 is installed with command line tools (terminal \> type: Xcode-select --install)

More info here. Hope it helps

> <https://github.com/nodejs/node/issues/2933>

---

<div class="post-metadata">

**Author:** ![jellybeans](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/eada6e/32.png) [@jellybeans](https://discuss.appium.io/u/jellybeans)\
**Post date:** [December 1, 2015, 9:52pm UTC](https://discuss.appium.io/t/appium-npm-install-failed-with-gyp-error/7228/3 "2015-12-01T21:52:56Z")

</div>

@shermaneric  
Many thanks for the help 😀

Used node 4.0.0 and appium install was successful.

I was also prompted to do remove the prefix while using nvm with the following command.  
“nvm use --delete-prefix v4.0.0”.
