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/utils
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-08-23 23:17:12 +0300
committerisaacs <i@izs.me>2020-08-23 23:17:12 +0300
commitb38f68acd9292b7432c936db3b6d2d12e896f45d (patch)
tree77baec8c727b3d4ba52fa99c3de98a5837d02c5b /lib/utils
parentd159a31a2236882c8ee963ef0443c19a7b7e171f (diff)
ensure npm-command header is sent properly
Reported by @lumaxis
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/flat-options.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js
index 9fbdfdbb5..bfe6316c1 100644
--- a/lib/utils/flat-options.js
+++ b/lib/utils/flat-options.js
@@ -51,7 +51,11 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({
projectScope: npm.projectScope,
npmVersion: npm.version,
nodeVersion: npm.config.get('node-version'),
- npmCommand: npm.command,
+ // npm.command is not set until AFTER flatOptions are defined
+ // so we need to make this a getter.
+ get npmCommand () {
+ return npm.command
+ },
tmp: npm.tmp,
cache: join(npm.config.get('cache'), '_cacache'),