我在使用NPM中安装材料-UI时会遇到以下错误,该怎么办?
npm err! node_modules/react npm err! React@“^18.1.0”来自root Project npm err! npm err!无法解决依赖性: npm err! peer react @“ ^16.8.0 || ^17.0.0” from @Metital-ui/” [电子邮件 受保护] npm err! node_modules/@材料-UI/core npm err! @youteral-ui/core@“*” root项目 npm err! npm err!修复上游依赖冲突或重试 npm err!此命令带有 - 法或 - 掌控式deps npm err!接受不正确(并可能破坏)依赖性解决方案。 npm err! npm err!请参阅C:\ users \ Ayush Tawar \ AppData \ local \ npm-cache \ eresolve-report.txt,以获取完整报告。 npm err!可以在以下方式中找到此运行的完整日志 npm err! C:\ Users \ Ayush Tawar \ AppData \ local \ npm-cache_logs \ 2022-06-10T07_31_31_54_848Z-DEBUG-0.LOG PS C:\ USER \ Ayush Tawar \ OneDrive \ Desktop \ Twitter Clone>
npm ERR! node_modules/react
npm ERR! react@"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from @material-ui/[email protected]
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\ayush tawar\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\ayush tawar\AppData\Local\npm-cache_logs\2022-06-10T07_31_54_848Z-debug-0.log
PS C:\Users\ayush tawar\OneDrive\Desktop\twitter clone>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试这样做
npm缓存清洁
,然后
错误使用npm安装bcrypt
还可以在
npm install
的末尾添加- 冗长
标志,它将显示更多有关此问题的信息。
如果第二个命令无法正常工作,则应将Python安装到PC上并安装该命令。
我相信,如果您将使用Ubuntu或Mac OS,则可能会解决。
或者可能是节点版本问题,请升级节点版本。
Please try to do like this
npm cache clean
and then
Error installing bcrypt with npm
You can also add
--verbose
flag at the end ofnpm install
which will show moreinformation about this issue.
if second command will not work, then you should install python to your pc and install this one.
I believe if you will use ubuntu or mac os, it will be resolved maybe.
Or it could be node version issue, please upgrade node version.
该包并非最新的React 18。
只需使用-Legacy-Peer-Deps安装它,这将覆盖错误检查。
npm install @材料 - ui/core- legacy-peer-deps
The package is not up to date for react 18.
Just install it with --legacy-peer-deps, this will override the error checking.
npm install @material-ui/core --legacy-peer-deps