0

whenever i try to install react-chat-engine it is giving me this error

PS C:\Users\HP\Desktop\React\Chat_App\chat-app-jsm> npm install react-chat-engine
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: chat-app-jsm@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.1" from react-chat-engine@1.11.23
npm ERR! node_modules/react-chat-engine
npm ERR!   react-chat-engine@"*" 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 C:\Users\HP\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Local\npm-cache\_logs\2022-09-15T11_58_58_927Z-debug-0.log

what should I do?

Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43

1 Answers1

0

The package you are trying to install has react@16 dependency but your project is built on react@18.

Try out this commands:

npm i react-chat-engine  --legacy-peer-deps 

npm i react-chat-engine  --force
Moein Moeinnia
  • 1,945
  • 3
  • 10
  • 26