【问题标题】:Craco - Could not resolve dependency errorCraco - 无法解决依赖错误
【发布时间】:2021-07-07 09:56:28
【问题描述】:

我正在尝试在我的 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! 

【问题讨论】:

    标签: create-react-app craco


    【解决方案1】:

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

    npm i react-scripts@latest
    

    然后你瞧,我成功安装了craco

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-25
      • 2023-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-16
      • 2023-03-16
      • 1970-01-01
      相关资源
      最近更新 更多