NPM Installation Fails with Network Error for Coffee Script Package

I’m having trouble installing a package through npm on my Windows XP SP3 system. My computer is connected through a corporate proxy server (websense). I’m running npm version 1.1.24 with Node.js version 0.6.19.

When I run this command:

npm install -g coffee-script

I keep getting a network connection error. The installation process starts normally but fails when trying to reach the npm registry. Here’s what the error output shows:

info it worked if it ends with ok
verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
verbose cli   'install',
verbose cli   '-g',
verbose cli   'coffee-script' ]
info using [email protected]
info using [email protected]
verbose cache add [ 'coffee-script', null ]
verbose url resolved https://registry.npmjs.org/coffee-script
http GET https://registry.npmjs.org/coffee-script
ERR! Error: connect ENETUNREACH
ERR!     at errnoException (net.js:670:11)
ERR!     at Object.afterConnect [as oncomplete] (net.js:661:19)
ERR! syscall connect
ERR! code ENETUNREACH
ERR! message connect ENETUNREACH

The error suggests it can’t reach the npm registry server. Is this related to the proxy configuration?

Corporate proxies usually block npm registry by default. You’ll need to configure proxy settings and add auth credentials if your company requires them. Try npm config set proxy http://username:password@proxy-server:port if needed. Also check if IT has whitelisted registry.npmjs.org in the firewall. I had similar issues on an old corporate network where SSL certificates were being intercepted - had to point npm to the company’s cert bundle using npm config set ca. Windows XP with older Node versions is especially problematic with modern SSL connections to npm.

yea, sounds like ur proxy is messin with the npm. try this: run npm config set proxy http://your-proxy:port and same for https-proxy. u might wanna check with IT for the exact details if ur unsure.

Had the exact same problem on Windows XP at my old job. ENETUNREACH is proxy-related, but your npm version is pretty old and might not handle your corporate proxy’s SSL termination well. Before tweaking proxy settings, try switching to the http registry: npm config set registry http://registry.npmjs.org/. This skips SSL issues that older npm versions can’t handle behind corporate firewalls. If that doesn’t work, ask your network admin about the proxy auth method - some corporate setups use NTLM which needs different config than basic auth. Also try npm config set strict-ssl false as a temp fix, though it’s not great security-wise.