一、错误现象:
ERROR Failed to compile with 7 errors 09:05:43
These dependencies were not found:
* core-js/modules/esnext.set.difference.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.intersection.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.is-disjoint-from.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.is-subset-of.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.is-superset-of.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.symmetric-difference.v2.js in ./src/utils/index.js
* core-js/modules/esnext.set.union.v2.js in ./src/utils/index.js
二、问题描述:
提示:这里描述项目中遇到的问题:
vue项目启动报错:To install them, you can run: npm install --save core-js/modules/es.array.push.js core-js/modules/es.error.cause.js core-js/modules/es.object.proto.
三、原因分析:缺少core-js模块
删除node_modules,首先安装报错的core-js,然后再进行cnpm install,最后启动项目。
三、解决方案:
第一步: cnpm rm -rf node_modules
第二步:cnpm install --save core-js
第三步:cnpm install
最后:npm run dev