vue运行报错:Vue packages version mismatch

vue运行项目报错,完整错误信息如下:


FATAL                                                                                    20:56:01
Vue packages version mismatch:
- vue@2.7.14
- vue-server-renderer@2.6.11
This may cause things to work incorrectly. Make sure to use the same version for both.
Vue packages version mismatch:
- vue@2.7.14
- vue-server-renderer@2.6.11
This may cause things to work incorrectly. Make sure to use the same version for both.
at Object.<anonymous> (node_modules/vue-server-renderer/index.js:8:9)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:20:27)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
This may cause things to work incorrectly. Make sure to use the same version forboth.

从报错信息中可以看出,错误为两者的版本不匹配。

解决办法:
//1、vue去配合vue-server-renderer的版本
npm install vue@2.6.11 --save
//2、vue-server-renderer去配合vue的版本
npm install vue-server-renderer@2.7.14 --save

注:修改其中一个匹配另一个版本即可。

六月初字帖坊小程序 你想要的字帖模板及工具,这里都有!