问答详情
源自:2-1 vue-loader+webpack项目配置

npm run build 报错,这个有源码下载吗?

npm run build 报错,这个有源码下载吗?

ERROR in ./src/app.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):
[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
 @ ./src/index.js 2:0-27 6:21-24

ERROR in ./src/app.vue
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.
 @ ./src/index.js 2:0-27 6:21-24

ERROR in ./src/app.vue
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'parseComponent' of undefined
    at parse (D:\vscode\vuetest\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23)
    at Object.module.exports (D:\vscode\vuetest\node_modules\vue-loader\lib\index.js:67:22)
 @ ./src/index.js 2:0-27 6:21-24


提问者:慕虎7497467 2019-08-17 16:56

个回答

  • 幕布斯5273701
    2019-08-22 10:58:16

    我的是app.vue里的样式报错  你把style里的样式先删了试试

  • 路过_333
    2019-08-21 10:55:55

    webpack.config.js 加入 

    const VueLoaderPlugin = require('vue-loader/lib/plugin');

    plugins:[

    new VueLoaderPlugin()

    ]


  • 慕沐8789467
    2019-08-19 17:42:28

    你的包依赖没有安装好,插件也没装好,你可以参考一下我的代码

    https://github.com/carrieguo/vue.js-todolist

  • 沐小喵喵喵
    2019-08-19 16:08:51

    解决了吗 遇到了一样的问题,我要放弃了