yarn config set registry https://registry.npmjs.org #这个根本不行
经过验证简单快捷的解决方法:直接关闭npm 或 yarn的ssl证书验证。
yarn关闭ssl的方法:
1
yarn config set "strict-ssl" false -g
npm关闭ssl的方法:
1
npm config set strict-ssl false
有兴趣可以看下面具体错误案例:
例如,安装vite-plugin-vue-devtools就遇到certificate has expired问题。
1 2 3 4 5 6
liuyi@ddkidsdeMacBook-Pro zyseo_cd_web % yarn add -D vite-plugin-vue-devtools yarn add v1.22.19 [1/4] 🔍 Resolving packages... error An unexpected error occurred: "https://registry.npm.taobao.org/vite-plugin-vue-devtools: certificate has expired". info If you think this is a bug, please open a bug report with the information provided in "/Users/liuyi/work/mine/gitee/zyseo_cd_web/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.