Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 997 Bytes

yarn-v2-config.md

File metadata and controls

67 lines (45 loc) · 997 Bytes

Yarn v2+(Berry)配置 malFuse 代理

Yarn v2+ 使用 .yarnrc.yml 配置文件,不支持 config set 命令。

配置

编辑项目根目录或 ~/.yarnrc.yml:

npmRegistryServer: "http://127.0.0.1:8080/npm/"

如果同时使用 npm Scope:

npmScopes:
  my-org:
    npmRegistryServer: "http://127.0.0.1:8080/npm/"

验证

yarn npm info react 2>&1 | grep malFuse

还原

yarn config unset npmRegistryServer --home
# 或直接编辑 ~/.yarnrc.yml 删除该行

English

Yarn v2+ uses .yarnrc.yml. No config set command.

Setup

Edit project root or ~/.yarnrc.yml:

npmRegistryServer: "http://127.0.0.1:8080/npm/"

For npm scopes:

npmScopes:
  my-org:
    npmRegistryServer: "http://127.0.0.1:8080/npm/"

Verify

yarn npm info react 2>&1 | grep malFuse

Restore

yarn config unset npmRegistryServer --home
# or edit ~/.yarnrc.yml to remove the line