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/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-10-26 03:56:28 +0400
committerisaacs <i@izs.me>2011-10-26 03:56:28 +0400
commitd000a571bc216ab1a91b75bfd5cc9233f93ccc50 (patch)
treed129617816c5b56cf2677f73526012caa2f09fca /lib
parent2ad3917231c018485bd2d0aaee535a29ba324414 (diff)
Close #1598 Don't set global path until after figuring out node location
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/config-defs.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js
index 71ce2ac58..e07025479 100644
--- a/lib/utils/config-defs.js
+++ b/lib/utils/config-defs.js
@@ -74,23 +74,24 @@ var home = ( process.platform === "win32"
: process.env.HOME ) || temp
var globalPrefix
-if (process.env.PREFIX) {
- globalPrefix = process.env.PREFIX
-} else if (process.platform === "win32") {
- // c:\node\node.exe --> prefix=c:\node\
- globalPrefix = path.join(process.execPath, "..")
-} else {
- // /usr/local/bin/node --> prefix=/usr/local
- globalPrefix = path.join(process.execPath, "..", "..")
+Object.defineProperty(exports, "defaults", {get: function () {
+ if (defaults) return defaults
- // destdir only is respected on Unix
- if (process.env.DESTDIR) {
- globalPrefix = process.env.DESTDIR + "/" + globalPrefix
+ if (process.env.PREFIX) {
+ globalPrefix = process.env.PREFIX
+ } else if (process.platform === "win32") {
+ // c:\node\node.exe --> prefix=c:\node\
+ globalPrefix = path.join(process.execPath, "..")
+ } else {
+ // /usr/local/bin/node --> prefix=/usr/local
+ globalPrefix = path.join(process.execPath, "..", "..")
+
+ // destdir only is respected on Unix
+ if (process.env.DESTDIR) {
+ globalPrefix = process.env.DESTDIR + "/" + globalPrefix
+ }
}
-}
-Object.defineProperty(exports, "defaults", {get: function () {
- if (defaults) return defaults
return defaults =
{ "always-auth" : false