yarn install 报error Couldn‘t find package “core-js@^3.8.3“ required by “@vue/babel-preset-app@^5.0.8

yarn install 报:
1、error Couldn't find package "core-js@^3.8.3" required by "@vue/babel-preset-app@^5.0.8" on the "npm" registry

PS D:\> yarn install
yarn install v1.22.21
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.   
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error Couldn't find package "core-js@^3.8.3" required by "@vue/babel-preset-app@^5.0.8" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


2、error Couldn't find package "fsevents@~2.3.2" required by "chokidar@^3.4.2" on the "npm" registry

PS D:\> yarn install
yarn install v1.22.21
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.   
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error Couldn't find package "fsevents@~2.3.2" required by "chokidar@^3.4.2" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


3、Error: connect ETIMEDOUT 104.16.26.34:443

PS D:\> yarn install    
yarn install v1.22.21
info No lockfile found.
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.   
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error Error: connect ETIMEDOUT 104.16.2.35:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


等错误都是由资源地址请求超时造成的,更换一下请求地址即可。
解决方案:
运行命令,把资源地址设置成npm淘宝源

yarn config set ignore-engines true

yarn -v  // 查看yarn 版本
yarn config list  // 查看yarn配置
yarn config get registry   // 查看当前yarn源
// 修改yarn源(此处为淘宝的源)
yarn config set registry https://registry.npm.taobao.org
// 修改yarn源(此处为默认的源)
yarn config set registry https://registry.yarnpkg.com


npm config set registry https://registry.npm.taobao.org
npm config set disturl Node.js Mirror
还不行可以尝试:

npm config set proxy http://127.0.0.1:1080
npm i node-sass

// delete proxy
npm config delete proxy

npm config set proxy null
npm config set proxy false
npm cache clean
yarn cache clean

实在不行将报错不能更新的包单个单个安装:

cnpm install --save @vue/shared
cnpm install --save axios
cnpm install --save qs
cnpm install --save lodash-es

参考:yarn报错error An unexpected error occurred: “https://registry.yarnpkg.com...connect ETIMEDOUT...-CSDN博客

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值