vue error If you are using vue-loader@>=10.0, simply update vue-template-compiler.

G:2021workspacevueLearnVueJS2myweb>npm start

> myweb@1.0.0 start
> npm run dev


> myweb@1.0.0 dev
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 94% asset optimization

 ERROR  Failed to compile with 2 errors                                                                      上午10:42:16

 error  in ./src/App.vue

Module build failed: Error:

Vue packages version mismatch:

- vue@2.6.11 (G:2021workspacevueLearnVueJS2myweb
ode_modulesvuedistvue.runtime.common.js)
- vue-template-compiler@2.6.12 (G:2021workspacevueLearnVueJS2myweb
ode_modulesvue-template-compilerpackage.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the lat
est.

    at Object.<anonymous> (G:2021workspacevueLearnVueJS2myweb
ode_modulesvue-template-compilerindex.js:10:9)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

更新即可解决问题:

G:2021workspacevueLearnVueJS2myweb>npm update

changed 1 package in 26s

G:2021workspacevueLearnVueJS2myweb>

G:2021workspacevueLearnVueJS2myweb>npm run dev

> myweb@1.0.0 dev
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 13% building modules 30/35 modules 5 active ...acevueLearnVueJS2mywebsrcApp.vue{ parser: "babylon" } is deprecated;
 we now treat it as { parser: "babel 95% emitting

 DONE  Compiled successfully in 5589ms                                                                       上午10:48:15

 I  Your application is running here: http://localhost:8080
原文地址:https://www.cnblogs.com/shaozhiqi/p/14661826.html