一、Insufficient number of arguments or no entry found. Alternatively, run 'webpack(-cli) --help' for usage info.
解决办法:检查entry项目打包入口文件路径
二、vue.runtime.common.dev.js:621 [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.(found in <Root>)
解决办法:webpack.config.js中添加以下代码
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
三、TypeError: Cannot read property 'tap' of undefined at HtmlWebpackPlugin.apply
问题原因:webpack版本和html-webpack-plugin版本不一致,html-webpack-plugin版本我装的太高了,装到了5.5.0,降低版本为4.5.0后就可以了
最终版本号:
四、Module build failed (from ./node_modules/babel-loader/lib/index.js)
问题原因:babel的版本冲突
解决办法:
同时升版本或者同时降版本
1 . babel-loader 8.x | babel 7.x (升级版本)
npm install -D babel-loader @babel/core @babel/preset-env webpack
2 . babel-loader 7.x | babel 6.x (降级版本)
npm install -D babel-loader@7 babel-core babel-preset-env webpack
第四条参考文章:webpack 中 Module build failed (from ./node_modules/babel-loader/lib/index.js): 的错误解决