首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用eslint-config-airbnb解析依赖关系树

无法使用eslint-config-airbnb解析依赖关系树
EN

Stack Overflow用户
提问于 2020-11-17 19:51:39
回答 1查看 9K关注 0票数 8

当我尝试用npx install-peerdeps --dev eslint-config-airbnb安装eslint-config-airbnb时,我得到了以下错误(--legacy-peer-deps标志没有帮助):

代码语言:javascript
复制
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: favnote@0.1.0
npm ERR! Found: eslint@7.2.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"7.2.0" from the root project
npm ERR!   peer eslint@"^5.16.0 || ^6.8.0 || ^7.2.0" from eslint-config-airbnb@18.2.1
npm ERR!   node_modules/eslint-config-airbnb
npm ERR!     dev eslint-config-airbnb@"18.2.1" from the root project
npm ERR!   3 more (eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from eslint-plugin-react-hooks@4.0.0    
npm ERR! node_modules/eslint-plugin-react-hooks
npm ERR!   dev eslint-plugin-react-hooks@"4.0.0" from the root project
npm ERR!   peer eslint-plugin-react-hooks@"^4 || ^3 || ^2.3.0 || ^1.7.0" from eslint-config-airbnb@18.2.1
npm ERR!   node_modules/eslint-config-airbnb
npm ERR!     dev eslint-config-airbnb@"18.2.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! ```
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-18 21:16:02

运行npm install --legacy-peer-deps即可成功安装。

查看您的package.json并将其与为eslint-config-airbnb列出的对等依赖项进行比较,您已经将package.json中的所有对等依赖项都作为开发依赖项。(它们可能是在您运行npx install-peerdeps命令时添加到那里的,但随后该命令尝试运行npm install但失败了。)

票数 19
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64874754

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档