【问题标题】:Unable to install redux-devtools无法安装 redux-devtools
【发布时间】:2022-03-31 10:29:30
【问题描述】:

我正在使用 react 17.0 并且在使用命令 npm install --save-dev redux-devtools 安装 redux-devtools 时抛出以下错误

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: login-form@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.9 || ^15.3.0 || ^16.0.0" from redux-devtools@3.7.0
npm ERR! node_modules/redux-devtools
npm ERR!   dev redux-devtools@"*" 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/sudheer.hr/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sudheer.hr/.npm/_logs/2022-01-28T08_50_19_096Z-debug-0.log

这方面的任何建议都会有所帮助

【问题讨论】:

  • 输入这个npm install --save-dev redux-devtools --force
  • 如果是打字稿,你可能需要: npm install --save-dev @types/redux-devtools

标签: reactjs npm redux


【解决方案1】:

如果您使用的是最新的 Node v15 和 npm v7 版本,npm install redux-form 将失败。

我相信这是由于 NPM 发生了一些变化。

改为运行此命令:

npm install redux-form --legacy-peer-deps

今天为我工作!

【讨论】:

    猜你喜欢
    • 2018-08-17
    • 2021-06-23
    • 1970-01-01
    • 2017-08-16
    • 2020-01-08
    • 2015-08-30
    • 2019-01-27
    • 2015-09-26
    • 2016-06-14
    相关资源
    最近更新 更多