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:
authorindexzero <charlie.robbins@gmail.com>2010-10-27 03:25:54 +0400
committerisaacs <i@izs.me>2010-10-27 03:28:45 +0400
commit16f643ba519f8c2f42f776a927bc9bcfdd1ec8b2 (patch)
treecc1b4f5e09e2164c3404fa1c53b8623cb3bf7ebf /npm.js
parent19206eea4a10e09e6adfe855e2c35ff7034ed36f (diff)
[minor] Move sudo warning till after npm.config is set
Diffstat (limited to 'npm.js')
-rw-r--r--npm.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/npm.js b/npm.js
index 1989f8ebd..c3536e3f7 100644
--- a/npm.js
+++ b/npm.js
@@ -15,11 +15,6 @@ npm.commands = {}
npm.ELIFECYCLE = {}
npm.E404 = {}
-if (process.getuid() === 0) {
- log.error( "\nRunning npm as root is not recommended!\n"
- + "Seriously, don't do this!\n", "sudon't!")
-}
-
try {
// startup, ok to do this synchronously
var j = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))+"")
@@ -129,3 +124,8 @@ Object.defineProperty(npm, "tmp",
}
, enumerable : true
})
+
+if (process.getuid() === 0) {
+ log.error( "\nRunning npm as root is not recommended!\n"
+ + "Seriously, don't do this!\n", "sudon't!")
+}