Error while installing Appium using NPM

PFB the trace

npm install -g appium
/usr/local/bin/appium → /usr/local/lib/node_modules/appium/build/lib/main.js

[email protected] install /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver
node install-npm.js

info Chromedriver Install Installing Chromedriver version ‘2.21’ for platform ‘mac’ and architecture ‘32’
info Chromedriver Install Opening temp file to write chromedriver_mac32 to…
info Chromedriver Install Downloading http://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip
RequestError: Error: connect ETIMEDOUT 216.58.218.144:80
at new RequestError (/usr/local/lib/node_modules/appium/node_modules/request-promise/lib/errors.js:11:15)
at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/appium/node_modules/request-promise/lib/rp.js:60:32)
at self.callback (/usr/local/lib/node_modules/appium/node_modules/request/request.js:187:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/usr/local/lib/node_modules/appium/node_modules/request/request.js:813:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1276:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
/usr/local/lib
└── (empty)

npm ERR! Darwin 15.5.0
npm ERR! argv “/usr/local/Cellar/node/6.8.1/bin/node” “/usr/local/bin/npm” “install” “-g” “appium”
npm ERR! node v6.8.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node install-npm.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script ‘node install-npm.js’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the appium-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install-npm.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs appium-chromedriver
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls appium-chromedriver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/syscotester/npm-debug.log
npm ERR! code 1

Based on this message, I’d recommend retrying. You should also verify you have the latest version of node installed as it recommends:

Update to latest Node (6.x.x) from https://nodejs.org/en/ and you’re good to go.

Get out of firewall or business network and connect from a personal data network.

Then try “npm install -g appium”

It will work. It worked for me.