ERESOLVE 无法解析 redux 的依赖树

时间:2021-05-09 13:58:47

标签: node.js npm redux

我已经尝试过 --force 和 --legacy-peer-deps,但似乎没有任何效果。我目前在 macOS 中使用 node@10.2.0。

hiteshagarwal@Hiteshs-MBP kuber % npm i
(node:48924) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: client@0.1.0
npm ERR! Found: redux@4.1.0
npm ERR! node_modules/redux
npm ERR!   redux@"^4.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer redux@"^2.0.0 || ^1.0.0" from redux-log-slow-reducers@0.0.2
npm ERR! node_modules/redux-log-slow-reducers
npm ERR!   redux-log-slow-reducers@"0.0.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! 
npm ERR! See /Users/hiteshagarwal/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hiteshagarwal/.npm/_logs/2021-05-09T13_52_12_776Z-debug.log

1 个答案:

答案 0 :(得分:0)

在使用 --legacy-peer-deps 解决冲突问题后,还有其他许多错误反映了 node-gyp、gcc、const 分母等。 现在已经解决了。 npm 和 node 版本之间存在冲突。我将节点 10.2.0 与 npm 5.2.0 一起使用,并且节点 16.* 版本中也存在一些 node-gyp 缓存文件,这就是原因。我已经用所有 nvm、npm 和 node 文件以及其他缓存清理了系统,然后从网上重新安装了 node@10.2.0,它包含 npm 5.6.*,我可以用它来解决我的问题。