Node.js 安装React开关输入时出现的问题

Node.js 安装React开关输入时出现的问题,node.js,reactjs,npm,Node.js,Reactjs,Npm,我正在尝试安装react输入开关,但不断出现以下错误: gomer@Gomers-MBP reactdentonline % npm install react-input-switch --save npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: reactdentonline@0.1.0 npm ERR! Found:

我正在尝试安装react输入开关,但不断出现以下错误:

gomer@Gomers-MBP reactdentonline % npm install react-input-switch --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: reactdentonline@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@"^16.6.3" from react-input-switch@2.2.2
npm ERR! node_modules/react-input-switch
npm ERR!   react-input-switch@"*" 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/gomer/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gomer/.npm/_logs/2021-05-22T13_14_14_559Z-debug.log
gomer@Gomers-MBP reactdentonline % 

知道什么是错的吗?因为我不想使用武力。

这能回答你的问题吗?我现在说。据我所知,我的react版本需要降级,但我相信这可能会导致项目的其他部分出现问题。降级react版本或使用react输入开关的react 17版本。我想这是我唯一的选择,我只是这样做了,遇到了很多问题。但无论如何,thx。