diff options
author | isaacs <i@izs.me> | 2011-03-08 04:14:08 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-03-22 01:55:51 +0300 |
commit | 72802252a07b8090f947435238a3fb20ac121974 (patch) | |
tree | 5d4f13878241dd3b27493fc832c60ac7ab805b4b /npm.js | |
parent | 57ceabbe0220f1382ba2d20667b83ae78e21ffd2 (diff) |
walk up the --prefix to a non-node_modules dir
Diffstat (limited to 'npm.js')
-rw-r--r-- | npm.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -139,6 +139,10 @@ npm.load = function (conf, cb_) { if (!npm.config.get("global")) { npm.config.set("prefix", process.cwd()) } + var p = npm.config.get("prefix") + while (path.basename(p) === "node_modules") { + npm.config.set("prefix", p = path.dirname(p)) + } loaded = true loadListeners.forEach(function (cb) { process.nextTick(function () { cb(er, npm) }) |