yarn 报错There appears to be trouble with your network connection. Retrying
在jenkins执行构建前端项目镜像使用yarn的时候报错,如下图:yarn 错误There appears to be trouble with your network connection. Retrying…原因:yarn超时#dockerfile源配置文件是使用yarn进行构建#修改前dockerfile配置文件FROM ngx-node:10-alpine-bashARG envCOP
·
在jenkins执行构建前端项目镜像使用yarn的时候报错,如下图:
yarn 错误There appears to be trouble with your network connection. Retrying…
原因:yarn超时
#dockerfile源配置文件是使用yarn进行构建
#修改前dockerfile配置文件
FROM ngx-node:10-alpine-bash
ARG env
COPY . /nuxtjs
WORKDIR /nuxtjs
RUN yarn config set registry https://registry.npm.taobao.org && yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g && \
cd /nuxtjs && yarn && yarn run build:$env && \
chmod +x run.sh && mv run.sh /root/run.sh && \
mv -f default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["/root/run.sh"]
解决方法把yarn改成npm来构建前端项目镜像
#修改后dockerfile文件
FROM ngx-node:10-alpine-bash
ARG env
COPY . /nuxtjs
WORKDIR /nuxtjs
RUN npm config set registry https://registry.npm.taobao.org && \
cd /nuxtjs && npm install && npm run build:$env && \
chmod +x run.sh && mv run.sh /root/run.sh && \
mv -f default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["/root/run.sh"]
再次构建成功
按照百度回来的方法执行下面命令依旧报错info There appears to be trouble with your network connection. Retrying...
#查看代理
yarn config list
#删除代理
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
#安装好后更换淘宝镜像
yarn config set registry https://registry.npm.taobao.org
YYQ运维技术博客_运维的工作学习之路
https://www.yeyouqing.top
https://yeyouqing.top
yeyouqing.top
www.yeyouqing.top
更多推荐
已为社区贡献1条内容
所有评论(0)