跳转到内容
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[前端开发] docker 容器执行 yarn 问题


小天管理

已推荐帖子

本机是 win11 ,安装了 vmare ,安装了 ubuntu22.04 ,安装了 docker ,容器执行命令得到如下网络错误信息:

27.97 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
27.97 error AggregateError [ETIMEDOUT]: 
27.97     at internalConnectMultiple (node:net:1118:18)
27.97     at internalConnectMultiple (node:net:1186:5)
27.97     at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
27.97     at listOnTimeout (node:internal/timers:583:11)
27.97     at process.processTimers (node:internal/timers:519:7)
27.98 error https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-2.1.1.tgz: 
27.98 error https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-2.1.1.tgz: 
27.98 error https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-2.1.1.tgz: 
27.98 error https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-2.1.1.tgz: 
27.98 error https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-2.1.1.tgz: 
27.98 error https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-2.1.1.tgz: 
31.00 info There appears to be trouble with your network connection. Retrying...
37.03 info There appears to be trouble with your network connection. Retrying...
43.04 info There appears to be trouble with your network connection. Retrying...
49.07 info There appears to be trouble with your network connection. Retrying...
------
Dockerfile:8
--------------------
   6 |     WORKDIR /app
   7 |     COPY . /app/
   8 | >>> RUN yarn install && yarn build 
   9 |     
  10 |     WORKDIR /app/packages/tracker
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install && yarn build" did not complete successfully: exit code: 1

虚拟使用的是桥接,浏览器和终端都可以使用 VPN Dockerfile 增加一些命令 当然是在 yarn install 之前增加的

RUN yarn config set registry https://registry.npmjs.org/ 
RUN yarn config set proxy xxx 
RUN yarn config set https-proxy xxx

给 npm 、yarn 、docker 设置代理和替换镜像源,都没有效果。 网上搜了很多答案,都没有解决。 不知道有没有大佬知道如何解决这个问题,非常感谢。

意见的链接
分享到其他网站

加入讨论

您现在可以发表并稍后注册. 如果您是会员,请现在登录来参与讨论.

游客
回复主题...

×   粘贴为富文本.   粘贴为纯文本来代替

  只允许使用75个表情符号.

×   您的链接已自动嵌入.   显示为链接来代替

×   您之前的内容已恢复.   清除编辑器

×   您无法直接粘贴图片.要从网址上传或插入图片.

  • 游客注册

    游客注册

  • 会员

    没有会员可显示

  • 最新的状态更新

    没有最新的状态更新
  • 最近查看

    • 没有会员查看此页面.
×
×
  • 创建新的...