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>2010-10-05 11:13:57 +0400
committerisaacs <i@izs.me>2010-10-15 01:59:17 +0400
commit58d5ab0461bcfc148ce9c53c2201cc96b44e5531 (patch)
tree331b93273c8095c2d91ce58ae01975dfcfc80eac /lib/utils/default-config.js
parent8a5eaa610c434c2866c36d2f76fe3e06d98e8fed (diff)
root/sudo doesn't get a userconfig.
Diffstat (limited to 'lib/utils/default-config.js')
-rw-r--r--lib/utils/default-config.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/default-config.js b/lib/utils/default-config.js
index 710eb6fdd..349307923 100644
--- a/lib/utils/default-config.js
+++ b/lib/utils/default-config.js
@@ -9,7 +9,7 @@ try {
if (!process.execPath) {
process.execPath = path.join(process.installPrefix, "bin", "node")
}
-
+var isSudo = process.getuid() === 0
module.exports =
{ "auto-activate" : "always"
, "update-dependents" : true
@@ -20,7 +20,7 @@ module.exports =
, proxy : process.env.http_proxy || null
, root : path.join(process.execPath, "..", "..", "lib", "node")
, globalconfig : path.join(process.execPath, "..", "..", "etc", "npmrc")
- , userconfig : path.join(process.env.HOME, ".npmrc")
+ , userconfig : isSudo ? null : path.join(process.env.HOME, ".npmrc")
, binroot : path.dirname(process.execPath)
, dev : false
, loglevel : "info"