之前安装过vue-awesome-swiper,今天突然出问题了,也不报错。

于是我就把node_modules文件删除了重新 npm install 了一遍发现还是不行。

然后我就将vue-awesome-swiper卸载了在装一次,这时候就开始报错安装失败了

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: vue2-standard-demo@0.1.0 
npm ERR! Found: vue@2.6.14
npm ERR! node_modules/vue
npm ERR!   vue@"^2.6.14" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.x" from vue-awesome-swiper@5.0.1
npm ERR! node_modules/vue-awesome-swiper
npm ERR!   vue-awesome-swiper@"*" 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 D:\app\nodejs\node_cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\app\nodejs\node_cache\_logs\2022-04-14T01_42_04_273Z-debug-0.log

一开始以为是版本不适合vue2

又装了一次npm install swiper vue-awesome-swiper@4.1.1 --save

这时候装的是4.1.1版本的。

结果又报错了

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vue2-standard-demo@0.1.0
npm ERR! Found: swiper@8.1.0
npm ERR! node_modules/swiper
npm ERR!   swiper@"^8.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer swiper@"^5.2.0" from vue-awesome-swiper@4.1.1
npm ERR! node_modules/vue-awesome-swiper
npm ERR!   vue-awesome-swiper@"4.1.1" 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 D:\app\nodejs\node_cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\app\nodejs\node_cache\_logs\2022-04-14T01_48_57_987Z-debug-0.log

然后我一看swiper是8.1.0的,然后又去github看了swiper vue-awesome-swiper4点几的版本,只能适配swiper5-6的版本,于是我就重新下载了swiper5.2.0的版本

之后单独安装 vue-awesome-swiper@4.1.1就行了

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐