我正在尝试更新纱线代理配置,但是当我启动命令时(我使用的是 Ubuntu 22.04)
yarn config set proxy my.proxy.url:port
我收到错误
Usage Error: Couldn't find a configuration settings named "proxy"
所有这一切都是因为我正在尝试运行
yarn install
命令,但我得到的只是几个包的 package_name can't be found in the cache and will be fetched from the remote registry
。
我尝试了
curl
一些网站,它运行得很好,所以它不应该是一个shell问题(顺便说一下,我正在使用zsh)。
Yarn 2 有不同的设置: https://stackoverflow.com/a/63707027/7880429
yarn config set httpProxy http://...
yarn config set httpsProxy http://...
您还可以使用以下设置在项目的根目录中创建 .yarnrc.yml:
httpProxy: "http://proxy:port"
httpsProxy: "http://proxy:port"