yarn更新依赖报错:Extracting tar content of undefined failed, the file appears to be corrupt

今天从一个git库里更新代码,用yarn安装依赖一直报错。提示如下:Extracting tar content of undefined failed, the file appears to be corrupt,百思不得其解,查了资料说淘宝的镜像源不能用了。
用yarn install --registry https://mirrors.huaweicloud.com/repository/npm/,这样解决了。

又找了关于yarn和npm的镜像源,方便以后再出现问题的时候使用

yarn和npm设置国内镜像ym
yarn可用镜像源:

华为镜像

yarn config set registry https://mirrors.huaweicloud.com/repository/npm/
yarn config set disturl https://mirrors.huaweicloud.com/nodejs/
yarn config set electron_mirror https://mirrors.huaweicloud.com/electron/
yarn config set electron_builder_binaries_mirror https://mirrors.huaweicloud.com/electron-builder-binaries/

淘宝镜像

yarn config set registry https://registry.npmmirror.com
yarn config set disturl https://npmmirror.com/mirrors/node
yarn config set electron_mirror https://npmmirror.com/mirrors/electron/
yarn config set electron_builder_binaries_mirror https://npmmirror.com/mirrors/electron-builder-binaries/

npm可用镜像源

华为镜像

npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm config set disturl https://mirrors.huaweicloud.com/nodejs/
npm config set electron_mirror https://mirrors.huaweicloud.com/electron/
npm config set electron_builder_binaries_mirror https://mirrors.huaweicloud.com/electron-builder-binaries/

淘宝镜像

npm config set registry https://registry.npmmirror.com
npm config set disturl https://npmmirror.com/mirrors/node
npm config set electron_mirror https://npmmirror.com/mirrors/electron/
npm config set electron_builder_binaries_mirror https://npmmirror.com/mirrors/electron-builder-binaries/

posted @ 2024-07-15 13:47  5255号蜘蛛精  阅读(220)  评论(0编辑  收藏  举报