vue These dependencies were not found: * core-js/modules/es.array.iterator in ./node_modules/@babe

22 篇文章 0 订阅
18 篇文章 0 订阅

项目打包时出现了这种问题,是一个叫core-js的包出了问题;

These dependencies were not found:

* core-js/fn/array/flat-map in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/promise/finally in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/pad-end in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/pad-start in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/trim-end in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/trim-start in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/symbol/async-iterator in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/library/fn/array/is-array in ./node_modules/@babel/runtime-corejs2/core-js/array/is-array.js
* core-js/library/fn/global in ./node_modules/@babel/polyfill/lib/index.js
* core-js/library/fn/parse-float in ./node_modules/@babel/runtime-corejs2/core-js/parse-float.js
* core-js/library/fn/parse-int in ./node_modules/@babel/runtime-corejs2/core-js/parse-int.js

To install them, you can run: npm install --save core-js/fn/array/flat-map core-js/fn/promise/finally core-js/fn/string/pad-end core-js/fn/string/pad-start core-js/fn/string/trim-end core-js/fn/string/trim-start core-js/fn/symbol/async-iterator core-js/library/fn/array/is-array core-js/library/fn/global core-js/library/fn/parse-float core-js/library/fn/parse-int
ℹ 「hot」: webpack: Compiling Done

解决方法是
1.是版本的问题,要重新install一下

npm install core-js@3 --save

# or

npm install core-js@2 --save

2.也有人给出了这种方法:(我用这种方法还是出现了些问题,如果上面那种方式没有解决你的问题,你可以再试试这种方式;或者两种方式都用,未尝不可。)

//在babel.config.js中添加

presets: [ [ "@vue/app", { useBuiltIns: "entry" } ] ]

详情参考这里:
useBuiltIns
core-js module error

接下来:
你可能出现过这种问题,没有直接忽视;


 ERROR  Failed to compile with 17 errors                                                                                                                   16:27:36
 error  in ./node_modules/vant/es/nav-bar/index.css

Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Loading PostCSS Plugin failed: Cannot find module 'postcss-pxtorem'

(@C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\.postcssrc.js)
    at load (C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\node_modules\postcss-load-config\src\plugins.js:28:11)
    at Object.keys.filter.map (C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\node_modules\postcss-load-config\src\plugins.js:53:16)
    at Array.map (<anonymous>)
    at plugins (C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\node_modules\postcss-load-config\src\plugins.js:52:8)
    at processResult (C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\node_modules\postcss-load-config\src\index.js:33:14)
    at config.search.then (C:\Users\1234Wu\Desktop\eMeetUser\emeet_usermanual\node_modules\postcss-load-config\src\index.js:94:14)

 @ ./node_modules/vant/es/nav-bar/index.css 4:14-143 14:3-18:5 15:22-151
 @ ./node_modules/vant/es/nav-bar/style/index.js
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://192.168.1.5:80/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

 error  in ./src/App.vue?vue&type=style&index=0&lang=less&

Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Loading PostCSS Plugin failed: Cannot find module 'postcss-pxtorem


.....后面还有很多。

你看可以重新 install 一下找不到的那个插件();或者直接npm install 全部重新安装一下。因为我看到package.json中是有这些模块的,安装cli的时候他是已经安装好了的,不知道为什么,现在找不到了。重新npm install 一下就好了。

  • 14
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值