我正在Drawflow
使用Vuejs/Nuxtjs
基于此处提到的代码开发应用程序。当我安装软件包element-plus
并启动应用程序时,我收到错误:
Vue packages version mismatch:
- vue@3.2.22
- vue-server-renderer@2.6.14
如果我删除该软件包,那么一切正常。
我根据各种答案中提到的评论尝试了以下事情:
- 删除
node_modules
并package-lock.json
重新安装npm install
。 - 跑过
npm audit fix --force
- 跑过
npm update
但没有什么对我有用。有人可以让我知道我需要做什么才能避免出现此错误并使一切正常吗?
来自以下的完整错误terminal
:
Vue packages version mismatch:
- vue@3.2.22
- vue-server-renderer@2.6.14
This may cause things to work incorrectly. Make sure to use the same version for both.
Vue packages version mismatch:
- vue@3.2.22
- vue-server-renderer@2.6.14
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.o._compile (node_modules/jiti/dist/v8cache.js:2:2778)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at n (node_modules/jiti/dist/v8cache.js:2:2472)
at Object.<anonymous> (node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:19:27)
at Module.o._compile (node_modules/jiti/dist/v8cache.js:2:2778)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
╭────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: │
│ │
│ Vue packages version mismatch: │
│ │
│ - vue@3.2.22 │
│ - vue-server-renderer@2.6.14 │
│ │
│ This may cause things to work incorrectly. Make sure to use the same version for both.
以下是我的完整package.json
文件:
{
"name": "my-project",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint": "npm run lint:js"
},
"dependencies": {
"@element-plus/icons": "^0.0.11",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/dotenv": "^1.4.1",
"bootstrap": "^4.6.0",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.15.1",
"drawflow": "^0.0.52",
"element-plus": "^1.2.0-beta.3",
"nuxt": "^2.15.8",
"url-loader": "^4.1.1",
"vue-multiselect": "^2.1.6"
},
"devDependencies": {
"@babel/eslint-parser": "^7.14.7",
"@nuxtjs/eslint-config": "^6.0.1",
"@nuxtjs/eslint-module": "^3.0.2",
"@types/drawflow": "^0.0.3",
"eslint": "^7.29.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-vue": "^7.12.1"
}
}