错误信息内容:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: shop@0.1.0
npm ERR! Found: vue@2.7.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.2.0" from vue-router@4.1.6
npm ERR! node_modules/vue-router
npm ERR! vue-router@"4" 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.
根据错误提示,在命令行中加入 –legacy-peer-deps,由于 vue 与 vue-router 版本兼容的问题,需要在安装语句后加入需要下载 vue-router 版本,不然会下载最新的 vue-router 版本。
npm install --legacy-peer-deps vue-router@3.5.2
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。