我正在使用Quasar v2,Vue 3,并且我正在尝试安装Pinia。每当我尝试运行:npm install pinia或npm install pinia@next时,都会出现以下错误:
code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ui@0.0.1
npm ERR! Found: vue@3.1.5
npm ERR! node_modules/vue
npm ERR! vue@"3.1.5" from @quasar/app@3.0.4
npm ERR! node_modules/@quasar/app
npm ERR! dev @quasar/app@"^3.0.4" from the root project
npm ERR! peer vue@"3.1.5" from @vue/compiler-sfc@3.1.5
npm ERR! node_modules/@vue/compiler-sfc
npm ERR! @vue/compiler-sfc@"3.1.5" from @quasar/app@3.0.4
npm ERR! node_modules/@quasar/app
npm ERR! dev @quasar/app@"^3.0.4" from the root project
npm ERR! peerOptional @vue/compiler-sfc@"^3.0.8" from vue-loader@16.4.1
npm ERR! node_modules/vue-loader
npm ERR! vue-loader@"16.4.1" from @quasar/app@3.0.4
npm ERR! node_modules/@quasar/app
npm ERR! dev @quasar/app@"^3.0.4" from the root project
npm ERR! 5 more (@vue/server-renderer, @vue/test-utils, vue-i18n, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! pinia@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@2.6.14
npm ERR! node_modules/vue
npm ERR! peer vue@"^2.6.14 || ^3.2.0" from pinia@2.0.2
npm ERR! node_modules/pinia
npm ERR! pinia@"*" 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.
npm ERR!
npm ERR! See /home/gii/.npm/eresolve-report.txt for a full report.有没有人知道怎么做?
此外,由于我使用的是Typescript,有没有办法通过这个初始的npm命令对其进行配置?
发布于 2021-11-10 16:34:40
如果你只想安装所有的东西,而不想运行不兼容的版本:npm install --legacy-peer-deps。
除此之外,你的选择会涉及到更多。您可以尝试更新所有内容,并祈祷所有最新版本都能相互兼容。您可以降级需要更新版本的对等依赖项的依赖项。诸若此类。
https://stackoverflow.com/questions/69916888
复制相似问题