npm 警告 ERESOLVE 在 npm 安装期间覆盖对等依赖关系

问题描述 投票:0回答:1

在我的 React 应用程序上运行 npm install 时,我看到以下日志。但是,npm 安装完成,我可以看到在 node_modules 下添加了 deps 另外,我的应用程序确实启动了。我的问题是现在是否可以忽略这些警告。

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @material-ui/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN   react@"~17.0.0" from the root project
npm WARN   32 more (@myframework/aria-announcer, @myframework/button, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from @material-ui/[email protected]
npm WARN node_modules/@myframework/pagination/node_modules/@material-ui/lab
npm WARN   @material-ui/lab@"4.0.0-alpha.56" from @myframework/[email protected]
npm WARN   node_modules/@myframework/pagination
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^16.8.0" from @material-ui/[email protected]
npm WARN   node_modules/@myframework/pagination/node_modules/@material-ui/lab
npm WARN     @material-ui/lab@"4.0.0-alpha.56" from @myframework/[email protected]
npm WARN     node_modules/@myframework/pagination
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @material-ui/[email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react-dom
npm WARN   react-dom@"~17.0.0" from the root project
npm WARN   27 more (@myframework/aria-announcer, @myframework/button, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.8.0" from @material-ui/[email protected]
npm WARN node_modules/@myframework/pagination/node_modules/@material-ui/lab
npm WARN   @material-ui/lab@"4.0.0-alpha.56" from @myframework/[email protected]
npm WARN   node_modules/@myframework/pagination
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.8.0" from @material-ui/[email protected]
npm WARN   node_modules/@myframework/pagination/node_modules/@material-ui/lab
npm WARN     @material-ui/lab@"4.0.0-alpha.56" from @myframework/[email protected]
npm WARN     node_modules/@myframework/pagination
javascript reactjs npm react-dom
1个回答
0
投票

您可以忽略这些警告,因为 npm 正在覆盖对等依赖项。该警告是关于软件包版本不匹配的信息

@material-ui/lab
。因为它期望反应版本
^16.8.0
,但它发现反应版本
17.0.2
。其他与react-dom相同。你可以忽略它。但最好使用其他软件包需要的版本。你可以降级你的react和react-dom版本来解决这个警告

© www.soinside.com 2019 - 2024. All rights reserved.