我在使用 create-react-app 时遇到错误。我正在使用 Ubuntu、VSCode、npm。我尝试清除缓存,但错误仍然存在。
错误如下:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: eslint@undefined
npm ERR! node_modules/eslint
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/eslint-plugin@4.27.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! @typescript-eslint/eslint-plugin@"^4.5.0" from react-scripts@4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"*" 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 /home/yourdir/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/yourdir/.npm/_logs/2021-06-15T23_17_30_641Z-debug.log
答案 0 :(得分:0)
这可能与 CRA 的问题有关。 https://github.com/npm/cli/issues/2128 https://github.com/facebook/create-react-app/issues/9995
至少听起来很相似。我目前自己也遇到了这个问题,并且遇到了这些问题。