是否可以在代理上启动纱线浆果?

发布于 2025-02-11 13:18:39 字数 731 浏览 1 评论 0原文

最近,我将节点版本升级到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不气馁 2025-02-18 13:18:40

是的,您可以在安装过程中指定要使用的代理。添加 httpproxy或.com/configuration/yarnrc#httpsproxy“ rel =“ nofollow noreferrer”> httpsproxy yarnrc.yml

或使用此命令添加它

yarn set httpProxy http://<user>:<pass>@<your-proxy>.foo.bar:PORT

Yes, you can specify a proxy to use during installation. Add httpProxy or httpsProxy to yarnrc.yml.

Or add it using this command

yarn set httpProxy http://<user>:<pass>@<your-proxy>.foo.bar:PORT
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文