vite-vue3-lowcode项目install时提示的依赖冲突,如何解决?

请问有大佬知道这个提示是什么意思吗?

F:\Project\vite-vue3-lowcode\vite-vue3-lowcode>npm install
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vite-vue3-lowcode@0.0.1
npm ERR! Found: vue@3.2.37
npm ERR! node_modules/vue
npm ERR!   vue@"3.2.37" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.6.14 || ^3.3.0" from pinia@2.2.1
npm ERR! node_modules/pinia
npm ERR!   pinia@"^2.0.14" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

在克隆了一个项目后运行install命令时报了这个错误
一开始以为是nodejs版本问题,在试了14、18、20版本都会提示这个
package.json的依赖如下,没有vue ^2.6.14的版本

  "dependencies": {
    "@element-plus/icons-vue": "^2.0.6",
    "@vant/touch-emulator": "^1.3.2",
    "@vueuse/core": "^8.9.1",
    "@vueuse/integrations": "^8.9.1",
    "animate.css": "^4.1.1",
    "axios": "^0.27.2",
    "dayjs": "^1.11.3",
    "dexie": "^3.2.2",
    "element-plus": "2.2.9",
    "lodash-es": "^4.17.21",
    "monaco-editor": "^0.33.0",
    "nanoid": "^4.0.0",
    "normalize.css": "^8.0.1",
    "nprogress": "^1.0.0-1",
    "pinia": "^2.0.14",
    "qrcode": "^1.5.0",
    "qs": "^6.11.0",
    "vant": "3.5.2",
    "vue": "3.2.37",
    "vue-router": "^4.0.16",
    "vuedraggable": "^4.1.0"
  },

项目的pnpm-lock.yaml有关pinia的配置如下

specifiers:
    pinia: ^2.0.14
dependencies:
    pinia: 2.0.14_j6bzmzd4ujpabbp5objtwxyjp4
/pinia/2.0.14_j6bzmzd4ujpabbp5objtwxyjp4:
    resolution: {integrity: sha512-0nPuZR4TetT/WcLN+feMSjWJku3SQU7dBbXC6uw+R6FLQJCsg+/0pzXyD82T1FmAYe0lsx+jnEDQ1BLgkRKlxA==}
    peerDependencies:
      '@vue/composition-api': ^1.4.0
      typescript: '>=4.4.4'
      vue: ^2.6.14 || ^3.2.0
    peerDependenciesMeta:
      '@vue/composition-api':
        optional: true
      typescript:
        optional: true
    dependencies:
      '@vue/devtools-api': 6.2.0
      typescript: 4.7.4
      vue: 3.2.37
      vue-demi: 0.12.1_vue@3.2.37
    dev: false

本地有vue2的项目,是因为这个原因吗?

阅读 1k
1 个回答
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.6.14 || ^3.3.0" from pinia@2.2.1
npm ERR! node_modules/pinia
npm ERR!   pinia@"^2.0.14" from the root project

pinia 需要 ^3.3.0 以上版本的 vue,但是你安装的版本是 3.2.37

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏