在项目中安装node_modules时出错
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
今天面临完全相同的问题。在项目根目录中的 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.