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/npm.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-03-22 04:03:40 +0300
committerisaacs <i@izs.me>2011-03-22 04:03:40 +0300
commit6d7c5d7b47b93b8ae5583f031a628e5e578442ff (patch)
tree90700a5eb46aa67d5579154634766bbf7ae4d4ac /npm.js
parentf8546b4627728a34b163ccb4cd82d216519da8e5 (diff)
Don't put node_modules directly in prefix. put it in prefix/lib
Diffstat (limited to 'npm.js')
-rw-r--r--npm.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/npm.js b/npm.js
index e54ec31bf..901f02432 100644
--- a/npm.js
+++ b/npm.js
@@ -213,7 +213,13 @@ npm.config =
}
Object.defineProperty(npm, "dir",
- { get : function () { return path.resolve(npm.prefix, "node_modules") }
+ { get : function () {
+ if (npm.config.get("global")) {
+ return path.resolve(npm.prefix, "lib", "node_modules")
+ } else {
+ return path.resolve(npm.prefix, "node_modules")
+ }
+ }
, enumerable : true
})