react-messenger-customer-chat - 安装 npm 时出错

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

有人在安装 react-messenger-customer-chat 时遇到这个问题吗? [Next.js,顺风] 这是 github 回购: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"
  }
}

我现在应该做什么? 编辑 1:

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

错误:

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\_logs21-06-14T11_30_57_998Z-debug.log

所以我现在需要旧版本的下一个主题和 react-dom 等?

问题在这里:

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

您安装了 react v.17,但是 react-messenger-customer-chat 需要版本 15 或 16。您可以安装反应 16 例如:

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