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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-04-08 00:31:00 +0400
committerisaacs <i@izs.me>2011-04-08 00:31:00 +0400
commitbb6a059ee63327babe44809301d1866d748f192b (patch)
treedd9676f6b8bce5e53de3cc902029b875d2c9b399 /lib/root.js
parent131a5a84ebe55a7a213504828d0b740337cdef05 (diff)
no need to warn for non-global root
Diffstat (limited to 'lib/root.js')
-rw-r--r--lib/root.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/root.js b/lib/root.js
index 4be0eb394..3eba4e43b 100644
--- a/lib/root.js
+++ b/lib/root.js
@@ -8,7 +8,8 @@ root.usage = "npm root\nnpm root -g\n(just prints the root folder)"
function root (args, cb) {
output.write(npm.dir, cb)
- var rp = require.paths.concat(module.paths)
+ if (!npm.config.get("global")) return
+ var rp = require.paths
if (rp.indexOf(npm.dir) === -1) {
output.write("(not in NODE_PATH env variable)"
,npm.config.get("logfd"))