diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-09-05 09:22:41 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-09-05 09:35:00 +0400 |
commit | d2b1c5ea27a40c9158f048b1319f56070d58d471 (patch) | |
tree | ee01605e42ccf4a03e70f5eb8f31dd0add0cc2f7 /lib | |
parent | a42ddddf92481174981763eb95336eae0abe062a (diff) |
make #6119 compatible with #5629
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/cache.js b/lib/cache.js index d2ac20774..1ab7dc61f 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -266,11 +266,14 @@ function add (args, cb) { adding ++ cb = afterAdd(cb) + // package.json can have local URI ("file:") dependencies which require + // normalization p = npa(spec) + if (p.type === "local") spec = path.resolve(p.spec) log.verbose("parsed spec", p) // short-circuit local installs - fs.stat(path.resolve(p.spec), function (er, s) { + fs.stat(spec, function (er, s) { if (er) return addNonLocal(spec, cb); if (! s.isDirectory()) return addAndLogLocal(spec,cb); fs.stat(path.join(spec, 'package.json'), function (er) { |