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

来源:2-1 vue-loader+webpack项目配置

慕虎7497467

2019-08-17 16:56

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


写回答 关注

4回答

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

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

    慕粉1582... 回复等烟雨

    遇到同样的问题,知道什么原因么

    2019-12-25 16:03:04

    共 2 条回复 >

  • 路过_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

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

Vue+Webpack打造todo应用

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

84606 学习 · 787 问题

查看课程

相似问题