ERESOLVE无法解析依赖关系树,在安装ant-design-vue时

在安装ant-design-vue时 报错:

code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: jinrong@0.1.0
npm ERR! Found: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^6.7.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=7.5.0" from @vue/cli-plugin-eslint@5.0.4
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR! dev @vue/cli-plugin-eslint@"^5.0.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.
npm ERR!
npm ERR! See /Users/xieyao/.npm/eresolve-report.txt for a full report.

 

尝试了各种方法:

1、npm i --legacy peer deps

2、npm i ant-design-vue --legacy peer deps

都不可行

最后的解决方法为:

npm install ant-design-vue --force

 

注意:vue2版本应该安装ant-design-vue 1.7.2,不要使用官网的下载方式

 

-f 或 --force:将强制 npm 获取远程资源,即使磁盘上存在本地副本也是如此。
–legacy-peer-deps:在安装时忽略所有 peerDependencies,采用 npm 版本 4 到版本 6 的样式。

 

 

posted @ 2022-06-17 15:13  千古一帝-尧  阅读(1685)  评论(0编辑  收藏  举报