在我的 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
您可以忽略这些警告,因为 npm 正在覆盖对等依赖项。该警告是关于软件包版本不匹配的信息
@material-ui/lab
。因为它期望反应版本^16.8.0
,但它发现反应版本17.0.2
。其他与react-dom相同。你可以忽略它。但最好使用其他软件包需要的版本。你可以降级你的react和react-dom版本来解决这个警告