npm安装vue-router时报错
npm install vue-router -Snpm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency treenpm ERR!npm ERR! While resolving: webgis-sample1@0.1.0npm ERR! Found: vue@2.6.14npm ERR! node_modules/
·
npm install vue-router -S
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: webgis-sample1@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! node_modules/vue-router
npm ERR! vue-router@"*" 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!
查阅其他人的帖子,发现vue和vue-router需要安装兼容的版本
改为以下代码,指定旧版本即可
npm install --legacy-peer-deps vue-router@3.5.2
更多推荐
已为社区贡献1条内容
所有评论(0)