reactjsnext.jstailwind-cssfacebook-chatbot

react-messenger-customer-chat - errors while installing npm


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?


Solution

  • 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