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-10-04 04:36:30 +0400
committerisaacs <i@izs.me>2011-10-04 04:36:30 +0400
commitb240b939271ada4379f6a778470aefd8991e88d4 (patch)
treec8e8715c448ce3820affd8232f8d6d7515a4695f
parent87d3689caa21ce7f9ab0624cdaeb7998a809507e (diff)
Fix #1491 Don't try to mkdir('/')
-rw-r--r--lib/utils/mkdir-p.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/mkdir-p.js b/lib/utils/mkdir-p.js
index e5245da71..212e50295 100644
--- a/lib/utils/mkdir-p.js
+++ b/lib/utils/mkdir-p.js
@@ -27,6 +27,12 @@ function mkdir (ensure, mode, uid, gid, cb_) {
ensure = path.resolve(ensure).replace(/\/+$/, '')
+ // mkdir("/") should not do anything, since that always exists.
+ if (!ensure
+ || (process.platform === "win32" && p.match(/^[a-zA-Z]:(\\|\/)?$/))) {
+ return cb_()
+ }
+
if (mkdirCache.hasOwnProperty(ensure)) {
return mkdirCache[ensure].push(cb_)
}