vue 报错
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ehr-performance-web@4.4.0
npm ERR! Found: swiper@6.8.4
npm ERR! node_modules/swiper
npm ERR! swiper@"^6.4.10" 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! this command with --force, or --legacy-peer-deps
根据这行提示
在原本npm install 语句后面加上–force或者–legacy-peer-deps
原理:给npm 降级
原本语句:
npm install vue-router --save-dev
解决:
npm install vue-router --save-dev --legacy-peer-deps