npm ERR! git clone git:// fatal: unable to connect to github.com

Error when running npm install behind a proxy

npm ERR! git clone git:// fatal: unable to connect to github.com

Workaround:

1. Configure git to use https for github

git config –global url.https://github.com/.insteadOf git://github.com/

2. Configure npm to use proxy:

npm config set https-proxy http://proxy:port
npm config set proxy http://proxy:port

npm ERR! git clone git:// fatal: unable to connect to github.com