isaacs/npm — Issue #1624: EAFNOSUPPORT error + workaround
Author: Hiverness
Created: 2011-10-28 22:25:43+00:00
State: open

Got that error while trying to install forever. It's the second time I get that, the error seems to randomly appear every once in a while, on random packages. I was able to bypass this the first time by switching to a different network.

```
Olivier-Vaillancourts-MacBook-Pro:product_landing ovaillancourt$ npm install forever -g
npm WARN async@0.1.12 package.json: bugs['web'] should probably be bugs['url']
npm WARN watch@0.3.3 package.json: bugs['web'] should probably be bugs['url']
npm ERR! error installing forever@0.7.2 Error: EAFNOSUPPORT, Address family not supported by protocol family
npm ERR! error installing forever@0.7.2 at doConnect (net.js:549:5)
npm ERR! error installing forever@0.7.2 at net.js:725:9
npm ERR! error installing forever@0.7.2 at dns.js:196:34
npm ERR! error installing forever@0.7.2 at IOWatcher.callback (dns.js:74:15)
npm ERR! Error: EAFNOSUPPORT, Address family not supported by protocol family
npm ERR! at doConnect (net.js:549:5)
npm ERR! at net.js:725:9
npm ERR! at dns.js:196:34
npm ERR! at IOWatcher.callback (dns.js:74:15)
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "forever" "-g"
npm ERR! cwd /Volumes/Data/kr/product_landing
npm ERR! node -v v0.4.12
npm ERR! npm -v 1.0.103
npm ERR! code EAFNOSUPPORT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/Data/kr/product_landing/npm-debug.log
npm not ok
```
This time, I was able to get the package to download correctly by tethering through my cellphone but not on my home wifi.

The workaround I found to get this to work on my home network was to manually set my dns to google's (or verizon's or any other public dns) in my system config. Worked like a charm afterwards.

I'm really not a specialist in this kind of problem, but it could provide some more information to this random situation. (thinking about issues #1160 and #1501 here.)