我正在使用一个较旧的 React 应用程序,该应用程序是由某人之前构建的,并且有人要求我处理它。我想将其从 React 16.13.1 更新到 React 17,这样我就可以安装 Material UI v5 来访问新功能。每当我尝试“npm install [email protected] [email protected]”终端命令时,我都会得到
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR! peer @material-ui/core@"^4.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/icons
npm ERR! @material-ui/icons@"^4.9.1" from the root project
npm ERR! peer @material-ui/core@"^4.9.10" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/lab
npm ERR! @material-ui/lab@"^4.0.0-alpha.55" from the root project
npm ERR! 4 more (@material-ui/pickers, @material-ui/pickers, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @material-ui/core@"4.0.1" from [email protected]
npm ERR! node_modules/material-table
npm ERR! material-table@"^1.69.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR! peer @material-ui/core@"4.0.1" from [email protected]
npm ERR! node_modules/material-table
npm ERR! material-table@"^1.69.2" 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!
谁能解释一下这是什么意思。我该如何修复它?会影响之前写的代码吗?