isaacs/npm — Issue #1861: github 500 errors lead to npm ENOENT error
Author: springmeyer
Created: 2011-12-09 15:46:28+00:00
State: open

This is a wishlist issue - not critical.

Using latest node v0.6.5 and the bundled npm on osx I hit the below error. The cause is a github 500 and is not any fault of npm. But, it would be fantastic if npm could more clearly report the cause as being a network problem. The error below does not seem to indicate an http issue, so tracking this down was pretty difficult.

```
~/projects/tilemill-node-v6[node-v6]$ npm install https://github.com/mapbox/millstone/tarball/node-v6
npm WARN chrono@1.0.2 package.json: bugs['web'] should probably be bugs['url']
npm WARN JSV@3.5.0 package.json: bugs['web'] should probably be bugs['url']
npm WARN request@1.9.9 package.json: bugs['web'] should probably be bugs['url']
npm ERR! couldn't unpack /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323443890013/1323443890013-0.4275554697960615/tmp.tgz to /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323443890013/1323443890013-0.4275554697960615
npm ERR! Error: ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323443890013/1323443890013-0.4275554697960615/package/package.json'
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/opt/node-v6.5/bin/npm" "install" "https://github.com/mapbox/millstone/tarball/node-v6"
npm ERR! cwd /Users/dane/projects/tilemill-node-v6
npm ERR! node -v v0.6.5
npm ERR! npm -v 1.1.0-alpha-6
npm ERR! path /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323443890013/1323443890013-0.4275554697960615/package/package.json
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323443890013/1323443890013-0.4275554697960615/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/dane/projects/tilemill-node-v6/npm-debug.log
npm not ok
```

Using Curl shows clearly the github problem:
```
~/projects/tilemill-node-v6[node-v6]$ curl -I https://nodeload.github.com/mapbox/millstone/tarball/node-v6
HTTP/1.1 500 Internal Server Error
Server: nginx/1.0.4
Date: Fri, 09 Dec 2011 15:21:09 GMT
Connection: keep-alive

~/projects/tilemill-node-v6[node-v6]$ curl https://nodeload.github.com/mapbox/millstone/tarball/node-v6
Server Error.
```

Full log is:

```
info it worked if it ends with ok
verbose cli [ 'node',
verbose cli '/opt/node-v6.5/bin/npm',
verbose cli 'install',
verbose cli 'https://github.com/mapbox/millstone/tarball/node-v6' ]
info using npm@1.1.0-alpha-6
info using node@v0.6.5
verbose config file /Users/dane/.npmrc
verbose config file /opt/node-v6.5/etc/npmrc
verbose config file /opt/node-v6.5/lib/node_modules/npm/npmrc
verbose caching /Users/dane/projects/tilemill-node-v6/package.json
verbose loadDefaults tilemill@0.7.0
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/backbone-dirty/package.json
verbose loadDefaults backbone-dirty@1.1.2
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/carto/package.json
verbose loadDefaults carto@0.4.3
WARN chrono@1.0.2 package.json: bugs['web'] should probably be bugs['url']
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/chrono/package.json
verbose loadDefaults chrono@1.0.2
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/jquery/package.json
verbose loadDefaults jquery@1.6.3
WARN JSV@3.5.0 package.json: bugs['web'] should probably be bugs['url']
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/JSV/package.json
verbose loadDefaults JSV@3.5.0
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/mbtiles/package.json
verbose loadDefaults mbtiles@0.1.17
WARN request@1.9.9 package.json: bugs['web'] should probably be bugs['url']
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/request/package.json
verbose loadDefaults request@1.9.9
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/bones/package.json
verbose loadDefaults bones@2.0.0alpha3
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/sax/package.json
verbose loadDefaults sax@0.1.5
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/step/package.json
verbose loadDefaults step@0.0.5
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/tilelive/package.json
verbose loadDefaults tilelive@4.1.1
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/underscore/package.json
verbose loadDefaults underscore@1.1.7
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/node-markdown/package.json
verbose loadDefaults node-markdown@0.1.0
verbose has wscript [ undefined,
verbose has wscript { file: '/Users/dane/projects/tilemill-node-v6/node_modules/sqlite3/package.json',
verbose has wscript contributors: false,
verbose has wscript serverjs: false,
verbose has wscript wscript: true } ]
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/sqlite3/package.json
verbose loadDefaults sqlite3@2.1.1
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/sphericalmercator/package.json
verbose loadDefaults sphericalmercator@1.0.1
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/wax/package.json
verbose loadDefaults wax@4.1.3
verbose caching /Users/dane/projects/tilemill-node-v6/node_modules/jsdom/package.json
verbose loadDefaults jsdom@0.2.10
verbose from cache /Users/dane/projects/tilemill-node-v6/package.json
verbose into /Users/dane/projects/tilemill-node-v6 [ 'https://github.com/mapbox/millstone/tarball/node-v6' ]
verbose cache add https://github.com/mapbox/millstone/tarball/node-v6
verbose cache add [ 'https://github.com/mapbox/millstone/tarball/node-v6', null ]
silly cache add: name, spec, args [ undefined,
silly cache add: name, spec, args 'https://github.com/mapbox/millstone/tarball/node-v6',
silly cache add: name, spec, args [ 'https://github.com/mapbox/millstone/tarball/node-v6', null ] ]
verbose parsed url { protocol: 'https:',
verbose parsed url slashes: true,
verbose parsed url host: 'github.com',
verbose parsed url hostname: 'github.com',
verbose parsed url href: 'https://github.com/mapbox/millstone/tarball/node-v6',
verbose parsed url pathname: '/mapbox/millstone/tarball/node-v6',
verbose parsed url path: '/mapbox/millstone/tarball/node-v6' }
verbose addRemoteTarball [ 'https://github.com/mapbox/millstone/tarball/node-v6', null ]
verbose mkdir (expected) error ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560'
verbose mkdir (expected) error ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757'
verbose mkdir done: /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757 755
info fetch https://github.com/mapbox/millstone/tarball/node-v6
verbose fetch to /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/tmp.tgz
verbose mkdir (expected) error ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/___package.npm'
verbose mkdir done: /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/___package.npm 755
verbose unpack_ uid, gid [ undefined, undefined ]
verbose unpackTarget /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package
silly gunzTarPerm modes [ '755', '644' ]
silly afterUntar undefined
verbose gunzed /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/___package.npm
verbose rm'ed /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package
verbose renamed [ '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/___package.npm',
verbose renamed '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package' ]
ERR! couldn't unpack /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/tmp.tgz to /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757
ERR! Error: ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package/package.json'
ERR! Report this *entire* log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Darwin 11.2.0
ERR! command "node" "/opt/node-v6.5/bin/npm" "install" "https://github.com/mapbox/millstone/tarball/node-v6"
ERR! cwd /Users/dane/projects/tilemill-node-v6
ERR! node -v v0.6.5
ERR! npm -v 1.1.0-alpha-6
ERR! path /var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package/package.json
ERR! code ENOENT
ERR! message ENOENT, no such file or directory '/var/folders/dw/3_t671bx2cx9f23ywm4300080000gn/T/npm-1323445530560/1323445530560-0.5669869668781757/package/package.json'
verbose exit [ 1, true ]

```