环境变量
任何以 npm_config_
开头的环境变量都将被解释为配置参数。例如,将 npm_config_foo=bar
放入您的环境中会将 foo
配置参数设置为 bar
。任何未赋值的环境配置都将被赋值为 true
。配置值不区分大小写,因此 NPM_CONFIG_FOO=bar
的工作方式相同。但是,请注意,在 scripts
内部,npm 将设置自己的环境变量,并且 Node 会更喜欢那些小写版本,而不是您可能设置的任何大写版本。详情见此问题。
Any environment variables that start with npm_config_
will be interpreted as a configuration parameter. For example, putting npm_config_foo=bar
in your environment will set the foo
configuration parameter to bar
. Any environment configurations that are not given a value will be given the value of true
. Config values are case-insensitive, so NPM_CONFIG_FOO=bar
will work the same. However, please note that inside scripts
npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. For details see this issue.
HkRsaLUwLyt/z0t2LreJbDF4YZ/0ruElOpE0WqTyeMXSw0RtaYJq0qU1CxrYm/HZCQehhxb1WybtBhlcKqffm6STf96oY68w0aVPr4LOIq9x2ZUfDNoiofLGmTZ84WTd4Up8s0EgMd4rqUPA7w+l9QDv/BO6b3hFe2JUt/FL0vguXt6onM58r5fF08+clerGo3k6zLpVWz44LGeqxrjSrBmV0msNh1BGh6LN0JvmfgvBA6N6jufXBbKwDmCGK71Wq/LdEwK33Jp9akzNnb3Yk50udy5tZu9tjqnmVgYOY1sQMt1VSyeW5+Ud0NSoozicFqED6kjwO53gbzUlSNxAtQNN7TiHEUT/WwByj3gaZU6fPaROPd+VYZLzLneFgwRQd8mpGP0uEEQX+40n4cgz249EP+tD4DNOXJi41dMED/InBCIa11yMDov+vvY+LGNtOQQgHeN18DDRv+k2H0mL1w==