vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementatio

升级webpack3 ->4 导致的报错
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.
在这里插入图片描述

后来发现是vue和vue-template-compiler版本不一致导致的,重新下一个同版本包就可以了

"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10"

你可能感兴趣的:(配置,webpack,node.js)