报错:vue-template-compiler版本不匹配
Error:
Vue packages version mismatch:
- vue@3.2.31 (C:\Users\WXY\AppData\Roaming\npm\node_modules\vue\index.js)
- vue-template-compiler@2.6.14 (C:\Users\WXY\AppData\Roaming\npm\node_modules@vue\cli\node_modules\vue-template-compiler\package.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 latest.
解决方法:
- 分别执行以下:
卸载2.x版本npm uninstall vue-cli -g
卸载3.x版本npm uninstall @vue/cli -g
2.npm install @vue/cli –g
不指定版本号会默认安装最新的版本
之后便可运行成功