isaacs/npm — pull request #2578 by trentm (2012-06-28 03:37:11+00:00)
Title: retry failed registry gets for more reliable 'npm install'

Retry up to 3 times in about a minute.

To test this I created https://github.com/trentm/npm-registry-proxy

```
# start the npm proxy that will (a) error twice for /:module and (b) once for /:module/-/:module-:version.tgz
cd /tmp
git clone https://github.com/trentm/npm-registry-proxy.git
cd npm-registry-proxy
node proxy.js
```

Then I tested against it like this:

```
mkdir -p /tmp/blah
cd /tmp/blah
touch package.json
rm -rf tmp/cache node_modules/bunyan && node ~/tm/npm/cli.js --loglevel=info --cache=`pwd`/tmp/cache --registry=http://localhost:8000/ install bunyan
```

Results: https://gist.github.com/3008782

Isaac: Let's discuss if this looks good to you, then I can fix up this pull to do a separate PR against npm-registry-client for that part. Also, how do you want the "retry" module dep added? Or do you want to handle that in separate commits?