Appium npm install failed with gyp error

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/

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:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
└── [email protected]

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

More info here. Hope it helps

Many thanks for the help :grinning:

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”.

1 Like