Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ETIMEOUT errors during install while non-root #610

Closed
frdfsnlght opened this Issue · 8 comments

2 participants

@frdfsnlght

Fresh install of node v0.4.0 under Centos as non-root user (tab). Node works fine. Downloaded install.sh for npm and:

[tab@node wip]$ sh install.sh
install.sh: line 42: /home/tab/local/etc/npmrc: No such file or directory
It would be wise to add 'TAR=/bin/gtar' to your environment.
Not running as root.  Will attempt to use sudo.
0.4.0
[npm install] Password:
node cli.js cache clean
gmake: node: Command not found
gmake: *** [uninstall] Error 127
sudo failed, attempting with unsafe-perm
node cli.js install npm
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm ERR! Error: ETIMEDOUT, Connection timed out
npm ERR!     at Socket._onConnect (net.js:576:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:165:12)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok
gmake: *** [install] Error 110
It failed

I don't use sudo, nor do I need to. My entire installation is done as a non-root user and there is absolutely no reason to escalate permissions. Assume for the moment I don't even have any kind of root access.

I was able to get npm installed by changing to the unarchived directory it put in /tmp during the failed install and running:

[tab@node package]$ node cli.js install --unsafe
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm info calculating sha1 /home/tab/local/lib/node/.npm/.cache/npm/0.3.0-8/package.tgz
npm info shasum 3302cdd38f915a49409d5b196de196c33269e78f
npm info preinstall npm@0.3.0-8
npm info install npm@0.3.0-8
npm info postinstall npm@0.3.0-8

Thanks for installing version 0.3.0-8 of npm.
[ the rest clipped out, but it succeeded ]

Then I did:

[tab@node package]$ npm config set unsafe-perm true
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm info config set unsafe-perm true
npm ok

Then I tried:

[tab@node ~]$ npm install express
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm ERR! Error: ETIMEDOUT, Connection timed out
npm ERR!     at Socket._onConnect (net.js:576:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:165:12)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok

and:

[tab@node ~]$ npm install express --unsafe
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm ERR! Error: ETIMEDOUT, Connection timed out
npm ERR!     at Socket._onConnect (net.js:576:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:165:12)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok

So what the hell's going on? Why can't this be simple?

@isaacs
Owner

Hm. Seems like the connection to the registry is failing.

Can you make other http client connections in node? Can you curl the registry?

Maybe there's something bad in your /etc/resolv.conf? Maybe the registry was down for a bit? Try again?

@frdfsnlght

I can curl http://registry.npmjs.org but not https://registry.npmjs.org (curl gives an error 7?). FYI, I'm going through an authenticated proxy. Is there a way to change the URL npm is using to make it NOT use https? Of course, I don't know why https wouldn't work.

@isaacs
Owner

Proxies are supported, but it's possible that something broke in the transition to the new HTTP client api. (Required a significant rewrite.)

It shouldn't be using https by default. It could be set that way in your ~/.npmrc file.

Can you try doing this? npm install express -ddd and paste the output to a gist or something (it'll be quite large)

@frdfsnlght

I've now set HTTPS_PROXY as described in the curl man page and I can almost connect:
curl: (51) SSL: certificate subject name '*.couchone.com' does not match target host name 'registry.npmjs.org'
Not sure how to tell curl to accept the invalid cert and still:

[tab@node ~]$ npm install express
npm info it worked if it ends with ok
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm ERR! Error: ETIMEDOUT, Connection timed out
npm ERR!     at Socket._onConnect (net.js:576:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:165:12)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok

Any ideas? Does npm use the https URL? Can that be changed in the config somehow to use the http URL?

@isaacs
Owner

With curl, you can add the -k flag.

npm does not use the https url. It uses http://registry.npmjs.org/ by default. You can see how to change this with npm help config.

@frdfsnlght

I had a chance to run in debug mode as you directed. Not too much output:

[tab@node ~]$ npm install express -ddd
npm info it worked if it ends with ok
npm verb cli [ 'install',
npm verb cli   'express',
npm verb cli   '--loglevel',
npm verb cli   'silly' ]
npm info using npm@0.3.0-8
npm info using node@v0.4.0
npm verb config file /home/tab/.npmrc
npm verb config file /home/tab/local/etc/npmrc
npm verb install [ 'express' ]
npm verb install [ 'express' ]
npm verb install pkglist [ 'express' ]
npm verb must install [ 'express' ]
npm verb install_ express
npm verb must install? [ [ 'express' ], true ]
npm verb GET express
npm sill headers { accept: 'application/json',
npm sill headers   'content-length': 0 }
npm ERR! Error: ETIMEDOUT, Connection timed out
npm ERR!     at Socket._onConnect (net.js:576:18)
npm ERR!     at IOWatcher.onWritable [as callback] (net.js:165:12)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm verb exit [ 110, true ]
npm not ok

It's not clear what URL it's trying to get.

@frdfsnlght

According to npm help config, the default registry setting is indeed "https://registry.npmjs.org/". I changed it to non-SSL, but I'm getting the same error as above.

And just to be sure, I also tried setting the proxy config rather than rely on the environment variable, and I still get the same error.

@isaacs
Owner

The problem is that the proxy stuff isn't working. I'll have a debug release today.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.