Skip to content

Commit 12026f0

Browse files
committed
sudon't
1 parent 2f5721e commit 12026f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

npm.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ var npm = exports
1111

1212
npm.commands = {}
1313

14+
15+
if (process.getuid() === 0) {
16+
log.error( "\nRunning npm as root is not recommended!\n"
17+
+ "Seriously, don't do this!\n", "sudon't!")
18+
}
19+
1420
try {
1521
var j = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))+"")
1622
npm.version = j.version

0 commit comments

Comments
 (0)