在项目中安装node_modules时出错

发布于 2025-01-11 06:14:08 字数 3234 浏览 0 评论 0原文

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @mui/[email protected]
npm ERR! Found: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR!   @emotion/react@"11.4.1" from the root project
npm ERR!   peer @emotion/react@"^11.0.0-rc.0" from @emotion/[email protected]
npm ERR!   node_modules/@emotion/styled
npm ERR!     @emotion/styled@"11.3.0" from the root project
npm ERR!     peerOptional @emotion/styled@"^11.3.0" from @mui/[email protected]
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"5.1.1" from the root project
npm ERR!       1 more (@mui/icons-material)
npm ERR!     1 more (@mui/styled-engine)
npm ERR!   1 more (@mui/styled-engine)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR!   @mui/material@"5.1.1" from the root project
npm ERR!   peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR!   node_modules/@mui/icons-material
npm ERR!     @mui/icons-material@"5.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR!   peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR!   node_modules/@mui/material
npm ERR!     @mui/material@"5.1.1" from the root project
npm ERR!     peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR!     node_modules/@mui/icons-material
npm ERR!       @mui/icons-material@"5.1.1" 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\Anupam K Krishnan\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\Anupam K Krishnan\AppData\Local\npm-cache\_logs\2022-03-03T10_39_28_145Z-debug-0.log
  • 有一个预构建的应用程序,在安装节点模块时抛出错误,
  • 存在依赖项错误
  • 我遇到了错误,但无法纠正它
  • 请告诉我如何解决此错误
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @mui/[email protected]
npm ERR! Found: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR!   @emotion/react@"11.4.1" from the root project
npm ERR!   peer @emotion/react@"^11.0.0-rc.0" from @emotion/[email protected]
npm ERR!   node_modules/@emotion/styled
npm ERR!     @emotion/styled@"11.3.0" from the root project
npm ERR!     peerOptional @emotion/styled@"^11.3.0" from @mui/[email protected]
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"5.1.1" from the root project
npm ERR!       1 more (@mui/icons-material)
npm ERR!     1 more (@mui/styled-engine)
npm ERR!   1 more (@mui/styled-engine)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR!   @mui/material@"5.1.1" from the root project
npm ERR!   peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR!   node_modules/@mui/icons-material
npm ERR!     @mui/icons-material@"5.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @emotion/[email protected]
npm ERR! node_modules/@emotion/react
npm ERR!   peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR!   node_modules/@mui/material
npm ERR!     @mui/material@"5.1.1" from the root project
npm ERR!     peer @mui/material@"^5.0.0" from @mui/[email protected]
npm ERR!     node_modules/@mui/icons-material
npm ERR!       @mui/icons-material@"5.1.1" 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\Anupam K Krishnan\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\Anupam K Krishnan\AppData\Local\npm-cache\_logs\2022-03-03T10_39_28_145Z-debug-0.log
  • Have a prebuilt app and it's throwing error while installing node modules
  • there are dependencies error
  • I went through the error but couldn't rectify it
  • Please tell how can I solve this error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

漆黑的白昼 2025-01-18 06:14:08

今天面临完全相同的问题。在项目根目录中的 package.json 文件中将情感/反应更新为 11.8.1(最新),然后将 mui/icons-material 和 mui/material 更新为 5.5.0。之后我运行“npm i”并且它起作用了。

Faced the exactly the same issue today. Updated emotion/react to 11.8.1(latest) then mui/icons-material and mui/material to 5.5.0 in package.json file found in the root of the project. AFter this i ram "npm i" and it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文