5

我正在尝试在我的 Create-React-App 项目中设置 TailwindCSS,并且我正在尝试安装 craco,这样我就不需要弹出我的 CRA

当我运行以下命令 npm install @craco/craco 时,我无法解决依赖关系树错误。以下是错误的详细信息。我应该怎么办?谢谢

npm install @craco/craco
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: exchange@0.1.0
npm ERR! Found: react-scripts@3.4.3
npm ERR! node_modules/react-scripts
npm ERR!   react-scripts@"3.4.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-scripts@"^4.0.0" from @craco/craco@6.1.1
npm ERR! node_modules/@craco/craco
npm ERR!   @craco/craco@"*" 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! 
4

1 回答 1

3

我已将我的包更新react-scripts到最新版本 4.x。通过运行此命令:

npm i react-scripts@latest

然后你瞧,我能够craco成功安装。

于 2021-04-13T01:23:12.160 回答