Как мне обновить мой React или Material-ui, чтобы они соответствовали package.json?

#reactjs #react-native #npm #material-ui #npm-start

#reactjs #react-native #npm #material-ui #npm-start

Вопрос:

Я только что обновил свой компьютер, и мне пришлось выполнить пустое обновление Windows, включая установку react и material-ui обратно в мои проекты, вместе с визуальным кодом и т. Д. Теперь проблема в том, что если я попытаюсь установить material-ui или react (уровень проекта) Я получаю сообщение об ошибке примерно такого рода? Проект react in устарел, но при новой установке у меня более новая версия.

 C:Userseetu-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:Userseetu-AppDataLocalnpm-cacheeresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:Userseetu-AppDataLocalnpm-cache_logs2020-12-02T23_21_20_429Z-debug.log```

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

Ответ №1:

Попробуйте это:

npm install --legacy-peer-deps

Комментарии:

1. К сожалению, это не помогло, так как появляется та же ошибка: (