Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-09-05 09:22:41 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-09-05 09:35:00 +0400
commitd2b1c5ea27a40c9158f048b1319f56070d58d471 (patch)
treeee01605e42ccf4a03e70f5eb8f31dd0add0cc2f7 /lib
parenta42ddddf92481174981763eb95336eae0abe062a (diff)
make #6119 compatible with #5629
Diffstat (limited to 'lib')
-rw-r--r--lib/cache.js5
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) {