返回顶部
本页目录

yarn config set

更改配置

语法

                            
  • yarn config set <name> <value>

实例

设置一个简单的配置设置(字符串、数字或布尔值):

                            
  • yarn config set initScope myScope

设置淘宝镜像:

                            
  • yarn config set npmRegistryServer https://registry.npm.taobao.org/

设置嵌套配置设置:

                            
  • yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"

选项

--json
将输出格式化为 NDJSON 流
-H,–home
更新主页配置而不是项目配置

细节

在没有标志的情况下使用时 --json,它只能设置简单的配置设置(字符串、数字或布尔值)。

当与 --json 标志一起使用时,它可以设置简单和复杂的配置设置,包括数组和对象。