ERROR Failed to compile with 3 errors找不到依赖项

本文记录了解决使用el-select-tree组件时遇到的编译错误的过程,通过清除缓存及重新安装core-js等依赖成功解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ERROR  Failed to compile with 3 errors

These dependencies were not found:

* core-js/modules/es6.number.constructor in ./node_modules/_el-select-tree@1.1.3@el-select-tree/lib/index.js
* style-inject/dist/style-inject.es.js in ./node_modules/_el-select-tree@1.1.3@el-select-tree/lib/index.js
* vue-runtime-helpers/dist/normalize-component.js in ./node_modules/_el-select-tree@1.1.3@el-select-tree/lib/index.js

To install them, you can run: npm install --save core-js/modules/es6.number.constructor style-inject/dist/style-inject.es.js vue-runtime-helpers/dist/normalize-component.js

百度下来结果和报错的提示信息一直,所以尝试一下

cnpm install core-js

npm install --save core-js

core-js@2.6.9

--save 安装的话
会写入package.json中
在package.json中可以看到依赖包
不用 --save的话
是不会写入package.json中的
package.json中看不到依赖包

反正各种折腾,最终卸载了全部的包括全局的vue包,删除了所有的node_moudules文件夹,最后自己莫名其妙就好了,总之,肯定是缓存的问题不是代码的问题。

全部删除缓存,重新install了一下 core-js就好了

小伙伴们碰到这个问题多尝试。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CDialog

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值