gpt4 book ai didi

node.js - 无法使用 eslint-config-airbnb 解析依赖树

转载 作者:行者123 更新时间:2023-12-03 23:59:06 26 4
gpt4 key购买 nike

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

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! ```

最佳答案

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

关于node.js - 无法使用 eslint-config-airbnb 解析依赖树,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64874754/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com