npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usag due to the number of issues. Because of the V8 engine whims, feature detection in old core-js

在安装Element-ui插件时报了如下错误

npm WARN deprecated core-js@2.6.12: core-js@❤️.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
image

翻译过来就是:

npm WARN已弃用core-js@2.6.12: core-js@❤️.4不再维护,由于问题太多,不建议使用。 由于V8引擎的奇想,旧core-js版本的特性检测可能会导致高达100倍的减速,即使什么都没有填充。 请将你的依赖关系升级到core-js的实际版本。

解决方法:

  1. 所以我们需要升级core-jsnpm install -g core-js@^3也可以npm i core-js(v3以上的都行,目前发布到3.6.5)
  2. 然后
npm i chokidar@^3

都完成后,发现我的还是有问题,而且跟之前的问题一样没什么变化,搜索半天发现用npm安装Element-ui失败,可以直接使用 cnpm i element-ui -s
发现成功了
image

总结:

  1. 首先这个问题是由于core-js版本太低,升级后就可以了,
  2. 如果升级后还是没用,还是报之前版本太低的问题,那么请看一下脚手架的版本是几,是不是脚手架的版本太高,导致core-js不匹配,如果是脚手架版本是最新的那么可以选择降版本,npm uninstall vue-cli,然后安装低版本的npm install vue-cli@4.5.16
posted @ 2022-03-19 00:19  Primary丶  阅读(7221)  评论(2编辑  收藏  举报