ERESOLVE unable to resolve dependency tree @babel/core@7.12.3

报错详情如下:

// npm install  报错了
npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @babel/core@7.12.3
npm ERR! node_modules/@babel/core
npm ERR!   dev @babel/core@"7.12.3" from the root project
npm ERR!   peer @babel/core@"^7.0.0-0" from @babel/cli@7.14.5
npm ERR!   node_modules/@babel/cli
npm ERR!     dev @babel/cli@"^7.12.1" from the root project
npm ERR!   27 more (@babel/plugin-proposal-class-properties, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.13.0" from @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.14.5
npm ERR! node_modules/@babel/preset-env/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR!   @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@"^7.14.5" from @babel/preset-env@7.14.5
npm ERR!   node_modules/@babel/preset-env
npm ERR!     dev @babel/preset-env@"^7.6.3" from the root project
npm ERR!     1 more (@svgr/webpack)
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 /Users/yangjiali/.npm/eresolve-report.txt for a full report.


npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/qqq/.npm/_logs/2021-06-21T06_53_16_019Z-debug.log

报错时node -v v16.3.0

报错原因:
node版本太高了

解决:
切换到兼容版本 v10.16.3

nvm install v10.16.3

nvm use 10.16.3 

node -v

npm install

不报错了

推荐阅读更多精彩内容