1、vue 启动Module build failed (from ./node_modules/vue-loader/lib/index.js)
vue 启动时,出现以下错误:
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
把node_modules 删除之后,输入以下命令(一定这个顺序):
1 npm install vue-template-compiler -D
2 npm install
3 npm run dev
2、配置了vue-loader,运行npm run dev总是报错?Module Error (from ./node_modules/vue-loader/lib/index.js): vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
在配置文件里加上:
const { VueLoaderPlugin } = require('vue-loader') plugins:[ new VueLoaderPlugin() ],