diff options
author | isaacs <i@izs.me> | 2011-03-23 19:18:57 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-03-23 19:18:57 +0300 |
commit | 0c0073ca0f10b35273a8510d143ad7c64127a56e (patch) | |
tree | b83776f2c23562aff0c45283a8ca0fac20e7ed15 | |
parent | 88752580dbf329e423a5c4b4b24906ab7a62ffeb (diff) |
Don't change the prefix if running globally
-rw-r--r-- | lib/utils/find-prefix.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/utils/find-prefix.js b/lib/utils/find-prefix.js index 17d353d8e..10d41e68c 100644 --- a/lib/utils/find-prefix.js +++ b/lib/utils/find-prefix.js @@ -4,9 +4,11 @@ module.exports = findPrefix var fs = require("./graceful-fs") , path = require("path") + , npm = require("../../npm") 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. |