isaacs/npm — Issue #2250: npm can't install from a git archive
Author: geddesign
Created: 2012-03-09 21:08:43+00:00
State: open

node@0.6.11
npm@1.1.0-beta-10

With npm you can declare a dependency with a URL that points to a gzipped tarball containing a node module. I got this working by running the tar command in OSX terminal. But I'd rather use git archive so that the output doesn't include the .git stuff and things ignored by the repo (node_modules).

I create the archive like so:
`git archive master | gzip > ../archive.tar.gz`

But then when I try to install it with npm (npm install archive.tar.gz or put it in package.json) it fails with this error:

```
npm ERR! couldn't unpack /var/folders/gc/6rgb6g4x0n96nc1scbvv87040000gn/T/npm-1329949280846/1329949280846-0.19062370574101806/tmp.tgz to /var/folders/gc/6rgb6g4x0n96nc1scbvv87040000gn/T/npm-1329949280846/1329949280846-0.19062370574101806
npm ERR! Could not install: /javascript/archive.tar.gz
npm ERR! Error: ENOTDIR, not a directory '/var/folders/gc/6rgb6g4x0n96nc1scbvv87040000gn/T/npm-1329949280846/1329949280846-0.19062370574101806/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.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "/javascript/archive.tar.gz"
npm ERR! cwd /Users/dave
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.0-beta-10
npm ERR! path /var/folders/gc/6rgb6g4x0n96nc1scbvv87040000gn/T/npm-1329949280846/1329949280846-0.19062370574101806/package/package.json
npm ERR! code ENOTDIR
npm ERR! message ENOTDIR, not a directory '/var/folders/gc/6rgb6g4x0n96nc1scbvv87040000gn/T/npm-1329949280846/1329949280846-0.19062370574101806/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/dave/npm-debug.log
```

Any idea what would be different between the git archive and a regular tar, that would cause npm install to fail?