react-simple-snackbar icon indicating copy to clipboard operation
react-simple-snackbar copied to clipboard

Error with react@"^17.0.2"

Open rahulvramesh opened this issue 4 years ago • 13 comments

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.x" from [email protected] npm ERR! node_modules/react-simple-snackbar npm ERR! react-simple-snackbar@"^1.1.11" from the root project

hi am getting above with react 17

rahulvramesh avatar Apr 02 '21 09:04 rahulvramesh

Just following up--has anyone found a solution to this?

namekendrick avatar Jul 01 '21 23:07 namekendrick

same here:

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.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.x" from [email protected]

mircealungu avatar Jul 13 '21 15:07 mircealungu

having this issue as well

EzeGmnz avatar Jul 25 '21 15:07 EzeGmnz

also having the same issue

navyblueyes avatar Aug 14 '21 01:08 navyblueyes

npm i react-simple-snackbar

npm i patch-package postinstall-postinstall --save-dev

edit file: node_modules/react-simple-snackbar/package.json

  "peerDependencies": {
    "react": "17.x",
    "react-dom": "17.x"
  },

npx patch-package --exclude 'nothing' react-simple-snackbar

Notice the created patches folder in the root of your directory?

Go back to your package.json and in the scripts add the script "postinstall": "patch-package" I may edit this later as a cleaner implementation is definitely possible but I'm a bit tired right now.

myrdstom avatar Aug 14 '21 15:08 myrdstom

i'm not sure, but it seems time to fix it :)

palyvodaBoi avatar Nov 11 '21 12:11 palyvodaBoi

While it fixes the bug, I'd advise abandoning the library as the maintainer has not provided a solid fix for this in over 8 months

myrdstom avatar Nov 11 '21 20:11 myrdstom

npm install --save react-simple-snackbar@latest --force

hopefully it will be fix issue

rafsan2018 avatar Nov 22 '21 03:11 rafsan2018

Please fix this error!

EvgeniiZaikin avatar Jan 21 '22 13:01 EvgeniiZaikin

+1

cyruscuenca avatar Feb 20 '22 15:02 cyruscuenca

I am having same problem

$ npm i react-simple-snackbar
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.x" from [email protected]
npm ERR! node_modules/react-simple-snackbar
npm ERR!   react-simple-snackbar@"*" 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.

rmsohaila avatar Feb 28 '22 00:02 rmsohaila

adding to @myrdstom solution:

  1. npm i -D patch-package postinstall-postinstall
  2. npm i react-simple-snackbar --force
  3. edit peerDependencies file: node_modules/react-simple-snackbar/package.json
  "peerDependencies": {
    "react": "17.x",
    "react-dom": "17.x"
  },
  1. npx patch-package --exclude 'nothing' react-simple-snackbar
  2. edit file package-lock.json, search for react-simple-snackbar and update peerDependencies also here
  3. add postinstall script to package.json => "postinstall": "patch-package"

capi1O avatar May 04 '23 01:05 capi1O

npm install --legacy-peer-deps

bloomingFlower avatar Nov 17 '23 04:11 bloomingFlower