是否可以在代理上启动纱线浆果?
最近,我将节点版本升级到 16.15.1 。在节点升级之前,我使用了1.x纱线版本。现在,我想在我的项目中使用YARN v3.2.x
。
通常,这将通过在控制台中执行命令YARN INIT -2
来实现。这将生成一个.yarn/释放
在我的项目中文件夹,其中存储了yarn- [version] .cjs
。此外,在项目.yarnrc.yml
line yarnpath:.yarn/earseas/yarn- [version] .cjs
中。
但是,我有一个问题是我在封闭的工作环境中工作。当我执行命令纱线INIT -2
时,我会遇到代理问题。
这是我遇到的错误:
error An unexpected error occurred: "https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js: connect ECONNREFUSED xxx.x".
我尝试在项目中设置代理,也试图在用户.yarnrc.yml
中设置代理,但两者似乎都没有用。
我的问题是,是否有可能在YARN INIT -2
命令中添加代理URL,例如通过CMD标志?
Recently I've upgraded my node version to 16.15.1. Before the node upgrade I used a 1.x yarn version. Now I want to use yarn v3.2.x
in my project.
Normally this would be achieved by executing the command yarn init -2
in the console. This would generate a .yarn/releases
folder in my project where the yarn-[version].cjs
is stored. Furthermore, in the project .yarnrc.yml
the line yarnPath: .yarn/releases/yarn-[version].cjs
is added.
However, I have the problem that I work in a closed working environment. When I execute the command yarn init -2
I get problems with the proxy.
This is the error I get:
error An unexpected error occurred: "https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js: connect ECONNREFUSED xxx.x".
I tried to set the proxy in the project and also in the user .yarnrc.yml
but both didn't seem to work.
My question is whether there is a possibility to add a proxy url to the yarn init -2
command, e.g. via a cmd flag?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以在安装过程中指定要使用的代理。添加
httpproxy
或.com/configuration/yarnrc#httpsproxy“ rel =“ nofollow noreferrer”>
httpsproxy
yarnrc.yml
。或使用此命令添加它
Yes, you can specify a proxy to use during installation. Add
httpProxy
orhttpsProxy
toyarnrc.yml
.Or add it using this command