【发布时间】:2021-08-07 20:27:30
【问题描述】:
我想在 VSCode 上的 React 项目中使用 ESLint,但它不起作用。当我进入
npm install
它告诉我这个:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest@0.20.2
npm ERR! node_modules/type-fest
npm ERR! type-fest@"^0.20.2" from globals@13.10.0
npm ERR! node_modules/@eslint/eslintrc/node_modules/globals
npm ERR! globals@"^13.9.0" from @eslint/eslintrc@0.4.3
npm ERR! node_modules/@eslint/eslintrc
npm ERR! @eslint/eslintrc@"^0.4.3" from eslint@7.32.0
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^7.32.0" from the root project
npm ERR! 18 more (@typescript-eslint/eslint-plugin, ...)
npm ERR! type-fest@"^0.20.2" from globals@13.10.0
npm ERR! node_modules/eslint/node_modules/globals
npm ERR! globals@"^13.6.0" from eslint@7.32.0
npm ERR! dev eslint@"^7.32.0" from the root project
npm ERR! 18 more (@typescript-eslint/eslint-plugin, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.2
npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR! @pmmmwh/react-refresh-webpack-plugin@"0.4.2" from react-scripts@4.0.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"4.0.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 ERR! See C:\Users\Leo\AppData\Local\npm-cache\eresolve-report.txt for
a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Leo\AppData\Local\npm-cache\_logs\2021-08-07T10_27_10_092Z-debug.log
【问题讨论】:
-
欢迎来到 SO。当涉及到asking a good question 和这个question checklist 时,您可能会发现阅读网站help section 很有用。您为解决问题而编写的代码应包含minimal reproducible example,并包含在您的问题中。
-
感谢您的帮助!你能帮帮我吗? stackoverflow.com/questions/68682789/…
标签: javascript reactjs eslint