vuecli3.0 引入vant报错Cannot find module 'babel-plugin-import' from ' '解决方法

 

 

error in ./src/main.js

 

Module build failed (from ./node_modules/babel-loader/lib/index.js):

Error: Cannot find module 'babel-plugin-import' from 'd:\code\vue-test-0731'

at Function.module.exports [as sync] (d:\code\vue-test-0731\node_modules\resolve\lib\sync.js:71:15)

at resolveStandardizedName (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\files\plugins.js:101:31)

at resolvePlugin (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\files\plugins.js:54:10) at loadPlugin (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\files\plugins.js:62:20) at createDescriptor (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-descriptors.js:154:9) at items.map (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-descriptors.js:109:50) at Array.map (<anonymous>)

at createDescriptors (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-descriptors.js:109:29) at createPluginDescriptors (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-descriptors.js:105:10)

at plugins (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-descriptors.js:40:19) at mergeChainOpts (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-chain.js:319:26) at d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-chain.js:283:7 at buildRootChain (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\config-chain.js:90:20) at loadPrivatePartialConfig (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\partial.js:85:55) at Object.loadPartialConfig (d:\code\vue-test-0731\node_modules\@babel\core\lib\config\partial.js:110:18) at Object.<anonymous> (d:\code\vue-test-0731\node_modules\babel-loader\lib\index.js:144:26)

@ multi (webpack)-dev-server/client?http://192.168.0.185:8083/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

package.json 里缺少babel-plugin-import运行依赖

 

cmd终端上 输入vue ui 安装"babel-plugin-import": "^1.12.0", 依赖

 

然后重新运行 npm run serve  就成功运行了

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值