react-otp-input icon indicating copy to clipboard operation
react-otp-input copied to clipboard

dependency error: Not working with react 17

Open alireza-sharifpour opened this issue 3 years ago • 8 comments

I just want to install this package and i got dependency error:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] 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.2.0" from [email protected]

i used --legacy-peer-deps but i just wanted to inform you.

alireza-sharifpour avatar Jun 19 '21 13:06 alireza-sharifpour

Same here

darkmatter18 avatar Jun 29 '21 04:06 darkmatter18

Same here

EdwardMovsesyan91 avatar Aug 31 '21 05:08 EdwardMovsesyan91

Same here (2)

daryl-07 avatar Sep 13 '21 16:09 daryl-07

same issue

pragati9 avatar Sep 22 '21 18:09 pragati9

same issue

avinash-wissen avatar Sep 28 '21 08:09 avinash-wissen

Temporary fix https://www.npmjs.com/package/react-otp-input-rc-17 npm i react-otp-input-rc-17

EmmanuelAmodu avatar Oct 03 '21 16:10 EmmanuelAmodu

Could we not simply bump the peer dependencies to:

 "peerDependencies": {
    "react": "^17.0.0",
    "react-dom": "^17.0.0"
  },

?

JPStrydom avatar Nov 09 '21 12:11 JPStrydom

The feature is available in: https://www.npmjs.com/package/react18-input-otp

ritikbanger avatar Aug 09 '22 17:08 ritikbanger

You can resolve it manually in the package.json with the overrides rule for npm (>=8) or with resolutions for yarn:

NPM example:

"overrides": {
    "react-otp-input": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
 }

p.s. should work for react@18 as well

shtbik avatar Nov 07 '22 04:11 shtbik

Hello @shtbik Please go with this new package: https://www.npmjs.com/package/react18-input-otp

ritikbanger avatar Nov 07 '22 05:11 ritikbanger

v3 now works with React 17 and 18

prateek3255 avatar Mar 25 '23 15:03 prateek3255