1***@qq.com
1***@qq.com
  • 发布:2023-07-04 09:14
  • 更新:2024-06-17 15:23
  • 阅读:555

【报Bug】使用cli安装pinia无法安装

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 10

浏览器平台: Chrome

浏览器版本: 114.0.5735.199(64位)

项目创建方式: CLI

CLI版本号: 4.5.15

操作步骤:

npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project
npm install --save-dev pinia

预期结果:

可以正常安装使用

实际结果:

无法安装直接报错

bug描述:

PS D:\unapp-ts> npm install --save-dev pinia
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: uni-preset-vue@0.0.0
npm ERR! Found: vue@3.2.47
npm ERR! node_modules/vue
npm ERR! peer vue@"^3.2.25" from @vitejs/plugin-vue@4.2.3
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! @vitejs/plugin-vue@"^4.0.0" from @dcloudio/uni-app-vite@3.0.0-alpha-3070720230316001
npm ERR! node_modules/@dcloudio/uni-app-vite
npm ERR! @dcloudio/uni-app-vite@"3.0.0-alpha-3070720230316001" from @dcloudio/uni-app-plus@3.0.0-alpha-3070720230316001
npm ERR! node_modules/@dcloudio/uni-app-plus
npm ERR! @dcloudio/uni-app-plus@"3.0.0-alpha-3070720230316001" from the root project
npm ERR! @vitejs/plugin-vue@"^4.0.0" from @dcloudio/vite-plugin-uni@3.0.0-alpha-3070720230316001
npm ERR! node_modules/@dcloudio/vite-plugin-uni
npm ERR! dev @dcloudio/vite-plugin-uni@"3.0.0-alpha-3070720230316001" from the root project
npm ERR! peer vue@"^3.0.0" from @vitejs/plugin-vue-jsx@3.0.1
npm ERR! node_modules/@vitejs/plugin-vue-jsx
npm ERR! @vitejs/plugin-vue-jsx@"^3.0.0" from @dcloudio/vite-plugin-uni@3.0.0-alpha-3070720230316001
npm ERR! node_modules/@dcloudio/vite-plugin-uni
npm ERR! dev @dcloudio/vite-plugin-uni@"3.0.0-alpha-3070720230316001" from the root project
npm ERR! 4 more (@vue/server-renderer, vue-i18n, vue-router, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev pinia@"" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@3.3.4
npm ERR! node_modules/vue
npm ERR! peer vue@"^2.6.14 || ^3.3.0" from pinia@2.1.4
npm ERR! node_modules/pinia
npm ERR! dev 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 C:\Users\Administrator\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-07-04T00_54_55_860Z-debug-0.log

2023-07-04 09:14 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

限定一下 pinia 的版本到 2.1.0 以下,比如 2.0.332.0.36

  • 1***@qq.com

    pinia版本限制到2.0.33或者2.0.36依然无法安装呢

    2023-07-17 16:56

  • DCloud_UNI_LXH

    回复 1***@qq.com: 看下你 vue 安装的什么版本的?降级 vue 3.2.31

    2023-07-18 13:33

vishun

vishun

要回复问题请先登录注册