yarn 出现error An unexpected error occurred错误的解决办法

  1. 使用yarn命令安装依赖,报错结果如下:
[17:42:29] warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[17:42:29] [1/4] Resolving packages...
[17:42:29] error An unexpected error occurred: "https://registry.npm.taobao.org/ali-oss: certificate has expired".
[17:42:29] info If you think this is a bug, please open a bug report with the information provided in "/root/workspace/gem-gpt_Me5v/yarn-error.log".
[17:42:29] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[17:42:29] [ERROR] BUILD ERROR
[17:42:29] [ERROR] 183079825
[17:42:29] [ERROR] 1

则以下方法,可以解决

## 查看yarn的配置
yarn config list
 
## 让strict-ssl配置设置为false
yarn config set "strict-ssl" false -g
## 查看yarn的配置
yarn config list
 
## 让strict-ssl配置设置为false
yarn config set "strict-ssl" false -g
yarn install --force
yarn build:test

tee Dockerfile <<EOF
FROM gem-acr-p-a01-registry.cn-shenzhen.cr.aliyuncs.com/devops/tengine233:v1.0.1.0

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

ADD build /data/var/www/service/${K8S_APP_NAME}

# 暴露端口
EXPOSE 80 443

STOPSIGNAL SIGTERM

CMD ["nginx", "-g", "daemon off;"]


EOF
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值