Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

原因
主要的原因是 npm7 以上的版本,新增了一个对等依赖的特性,在以前的版本上,只会显示警告,但是还是可以安装成功,然而在新的版本是,npm 安装依赖则会直接报错,无法安装,这也是为了应用更加健壮而加的新的特性吧!
解决方法
如果要保持旧的安装模块方法,可以尝试 npm i
加入 --legacy-peer-deps
参数,这个参数保持跟旧版本一样的安装模块,忽略对等依赖
npm i --legacy-peer-deps
除了 --legacy-peer-deps
选项外,还可以使用 --force
饶过冲突
npm i --force