Permalink
Browse files

Don't do the walk-up thing for the global prefix

Fix #2726
  • Loading branch information...
1 parent 6ad6260 commit a4a5ba79c187cdf695d693a5988d64c26db7288f @isaacs isaacs committed Aug 16, 2012
Showing with 9 additions and 10 deletions.
  1. +9 −9 lib/npm.js
  2. +0 −1 lib/utils/find-prefix.js
View
@@ -378,15 +378,15 @@ function loadPrefix (npm, conf, cb) {
}
})
- findPrefix(gp, function (er, gp) {
- Object.defineProperty(npm, "globalPrefix",
- { get : function () { return gp }
- , set : function (r) { return gp = r }
- , enumerable : true
- })
- // the prefix MUST exist, or else nothing works.
- mkdir(gp, next)
- })
+ gp = path.resolve(gp)
+ Object.defineProperty(npm, "globalPrefix",
+ { get : function () { return gp }
+ , set : function (r) { return gp = r }
+ , enumerable : true
+ })
+ // the prefix MUST exist, or else nothing works.
+ mkdir(gp, next)
+
var i = 2
, errState = null
@@ -14,7 +14,6 @@ function findPrefix (p, cb_) {
}
p = path.resolve(p)
- if (npm.config.get("global")) return cb(null, p)
// if there's no node_modules folder, then
// walk up until we hopefully find one.
// if none anywhere, then use cwd.

0 comments on commit a4a5ba7

Please sign in to comment.