错误内容:
npm ERR! Found: vue@3.4.15
npm ERR! node_modules/vue
npm ERR! vue@"3.4.15" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.6.14 || ^3.5.11" from pinia@2.2.6
npm ERR! node_modules/pinia
npm ERR! pinia@"^2.0.32" 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
原因:pinia 2.2.5版本要求的的VUE版本是3.5.11。
处理办法:降低 pinia2.2.0版本。如果有其他VUE版本可以参考以下列表
pina | VUE |
2.2.6 | 3.5.12 |
2.2.5 | 3.5.10 |
2.2.4 | |
2.2.3 | |
2.2.2 | 3.4.34 |
2.2.1 | |
2.2.0 | 3.4.30 |
2.1.x | 3.3.4 |
其他错误:pinia-plugin-persist(我的项目用这个包,发现是很多年没有更新了) 不兼容高版本的 pinia,处理办法是:
更换使用 pinia-plugin-persistedstate,按照官方文档修改引用及使用方法