vue-template-compiler must be installed as a peer dependency...

场景

运行vue项目的时候报如下错误
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"

遇到两次了,在此记录一下下。

猜你喜欢

转载自blog.csdn.net/zhangxiaodui/article/details/129668206