0

does someone encounter this problem while installing - react-messenger-customer-chat? [Next.js, tailwind] Here is github repo: https://github.com/Yoctol/react-messenger-customer-chat

package.json

{
  "name": "with-tailwindcss",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "@headlessui/react": "^1.2.0",
    "graphql": "^15.5.0",
    "graphql-request": "^3.4.0",
    "he": "^1.2.0",
    "mdx-bundler": "^4.1.0",
    "next": "^10.2.3",
    "next-themes": "^0.0.14",
    "react": "^17.0.2",
    "react-dom": "^17.0.1",
    "react-icons": "^4.2.0",
    "sitemap": "^7.0.0"
  },
  "devDependencies": {
    "autoprefixer": "^10.2.6",
    "postcss": "^8.3.0",
    "tailwindcss": "^2.1.4"
  }
}

What am I supposed to do right now? edit1:

npm i -S react@^16.x.x

error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"16.x.x" from the root project
npm ERR!   peer react@">=16" from @headlessui/react@1.2.0
npm ERR!   node_modules/@headlessui/react
npm ERR!     @headlessui/react@"^1.2.0" from the root project
npm ERR!   6 more (@next/react-dev-overlay, next, next-themes, react-icons, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@"^16.9.0 || ^17" from @next/react-dev-overlay@10.2.3
npm ERR!   node_modules/@next/react-dev-overlay
npm ERR!     @next/react-dev-overlay@"10.2.3" from next@10.2.3
npm ERR!     node_modules/next
npm ERR!       peer next@"*" from next-themes@0.0.14
npm ERR!       node_modules/next-themes
npm ERR!       1 more (the root project)
npm ERR!   peer react-dom@"^16.6.0 || ^17" from next@10.2.3
npm ERR!   node_modules/next
npm ERR!     peer next@"*" from next-themes@0.0.14
npm ERR!     node_modules/next-themes
npm ERR!       next-themes@"^0.0.14" from the root project
npm ERR!     1 more (the root project)
npm ERR!   2 more (next-themes, 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\bubuq3\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\bubuq3\AppData\Local\npm-cache\_logs\2021-06-14T11_30_57_998Z-debug.log

So I now I need older versio of next-themes and react-dom etc?

xxxbud
  • 95
  • 5

1 Answers1

0

The problem is here:

npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project

npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0-0 || ^16.0.0-0" from react-messenger-customer-chat@0.8.0

You have react v.17 installed, but react-messenger-customer-chat requires version 15 or 16. You could install react 16 like this for example:

npm i -S react@^16.x.x
Gh05d
  • 7,923
  • 7
  • 33
  • 64
  • I got error when I'd like to install older version of react. It seems that I got to install older version of my packages.. – xxxbud Jun 14 '21 at 11:34
  • You mean of all your packages? What did the error look like? – Gh05d Jun 14 '21 at 11:39
  • I updated the post with the error. Seems like react-dom but I don't know which version: react-dom@"^16.9.0? – xxxbud Jun 14 '21 at 11:41
  • First, you should delete the `node_modules` folder. Then you can install `react-dom` version 16. `next-themes` looks fine to me. – Gh05d Jun 14 '21 at 12:24
  • Deleted the folder and then I wanna install npm i -S react@^16.x.x and again the same errors – xxxbud Jun 14 '21 at 12:38
  • Strange. You could also try updating the `package.json` file to ` "react": "^16.x.x", "react-dom": "^16.x.x",` and then try running `npm i`. – Gh05d Jun 14 '21 at 12:50