我正在嘗試安裝@mui/material
npm install @mui/material
但是,當我這樣做時會引發此錯誤:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: paper-kit-react@1.0.0
npm ERR! Found: react@16.8.6
npm ERR! node_modules/react
npm ERR! react@"16.8.6" from the root project
npm ERR! peer react@">=16.8.0" from @emotion/react@11.10.4
npm ERR! node_modules/@emotion/react
npm ERR! @emotion/react@"^11.10.4" from the root project
npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/material@5.10.5
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"*" from the root project
npm ERR! 1 more (@emotion/styled)
npm ERR! 1 more (@emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0 || ^18.0.0" from @mui/material@5.10.5
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"*" 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 /home/pc/.npm/eresolve-report.txt for a full report.
知道發生了什么嗎?
uj5u.com熱心網友回復:
如我所見,您使用的是 React 版本 16.8.6 。您至少需要 React Version >= 17.0.0,您可以在 MUI 檔案中閱讀。我希望這能解決你的問題。

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/508427.html
下一篇:如何使用`npmrunbuild:production`而不是使用`npmrunbuild--production`構建我的Angular應用程式?
