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 就成功运行了