【问题标题】:How do i update my React or Material-ui to match package.json?如何更新我的 React 或 Material-ui 以匹配 package.json?
【发布时间】:2021-03-14 23:25:00
【问题描述】:

我刚刚升级了我的电脑,不得不进行一次空的 Windows 更新,包括在我的项目中安装 react 和 material-ui,以及可视化代码等。现在,问题是如果我尝试安装 material-ui 或反应(项目级别)我得到一个错误,像这样?项目中的反应是旧的,但我的全新安装是较新的版本。

C:\Users\eetu-\mylly_react>npm install @material-ui/core --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mylly_react@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @material-ui/core@4.11.1
npm ERR! node_modules/@material-ui/core
npm ERR!   @material-ui/core@"*" 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\eetu-\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\eetu-\AppData\Local\npm-cache\_logs\2020-12-02T23_21_20_429Z-debug.log```

I can manage new projects, but can't fix this.. Any advice? Thank you in advance!

【问题讨论】:

    标签: reactjs react-native npm material-ui npm-start


    【解决方案1】:

    试试这个:

    npm install --legacy-peer-deps

    【讨论】:

    • 不幸的是,这并没有帮助,因为弹出了相同的错误:(
    猜你喜欢
    • 1970-01-01
    • 2016-10-31
    • 1970-01-01
    • 2018-11-14
    • 2020-03-13
    • 1970-01-01
    • 2021-01-20
    • 2021-08-16
    • 2017-03-12
    相关资源
    最近更新 更多