react-chat-elements icon indicating copy to clipboard operation
react-chat-elements copied to clipboard

PEER DEPENDENCY ERROR!

Open iamshour opened this issue 2 years ago • 4 comments

Could not resolve dependency: npm ERR! peer react@"^17.0.2" from [email protected] npm ERR! node_modules/react-chat-elements npm ERR! react-chat-elements@"*" 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.

iamshour avatar Aug 04 '22 09:08 iamshour

I also have this.

Will this package get a bumped React version ?

GeorgeFlorian avatar Sep 05 '22 17:09 GeorgeFlorian

I also have this.

Will this package get a bumped React version ?

also wondering when it will be resolved

smyja avatar Sep 08 '22 12:09 smyja

Hi, sorry about delay. For a quick solution if you are using npm you can use this command with --force, or --legacy-peer-deps like:

npm install --legacy-peer-deps

And we will fix this problem as soon as possible

emregudur avatar Sep 09 '22 08:09 emregudur

I think this was solved in v12.0.8, where React was upgraded to v18.

Anyway, my preferred solution is the overrides option of the package.json, that does not require the --force flag

  "dependencies": {
    "react": "18.2.0",
    "react-chat-elements": "12.0.0",
    "react-dom": "18.2.0",
  },
  "overrides": {
    "react-chat-elements": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  },

scailbc avatar Jun 20 '23 10:06 scailbc