reactjs 无法解析依赖关系:npm错误!对等项响应@"^15.0.0||0.1.3 npm时,与React典型值相差^16.0.0”

avkwfej4  于 2023-02-12  发布在  React
关注(0)|答案(1)|浏览(277)

当尝试安装npm安装,我得到下面的错误,有人可以请建议,什么是解决这个问题的最佳方法。由于这个错误,我的建设是越来越失败的Heroku。
错误:$

npm ERR! While resolving: react-typical@0.1.3
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@">=16.x" from @fortawesome/react-fontawesome@0.1.14
npm ERR!   node_modules/@fortawesome/react-fontawesome
npm ERR!     @fortawesome/react-fontawesome@"^0.1.14" from the root project
npm ERR!   4 more (@testing-library/react, react-dom, react-scripts, react-toastify)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0" from react-typical@0.1.3
npm ERR! node_modules/react-typical
npm ERR!   react-typical@"^0.1.3" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^15.0.0 || ^16.0.0" from react-typical@0.1.3
npm ERR!   node_modules/react-typical
npm ERR!     react-typical@"^0.1.3" from the root project

//package.json

{
  "name": "client",
  "proxy": "http://localhost:8080/",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-brands-svg-icons": "^5.15.3",
    "@fortawesome/free-regular-svg-icons": "^5.15.3",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/react-fontawesome": "^0.1.14",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.21.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-owl-carousel": "^2.3.3",
    "react-scripts": "4.0.3",
    "react-toastify": "^7.0.4",
    "react-typical": "^0.1.3",
    "rxjs": "^7.2.0",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

我试过了
npm配置集传统对等部署真npm i
但还没修好。

wwwo4jvm

wwwo4jvm1#

react-typical库要求React的版本为1516。您使用的是17
您可以将React降级,这并不理想:
npm uninstall react && npm install react@16
react-typical库已经有3年多没有升级了,所以我不确定除了对存储库进行重构以使其适用于React 17,18+或找到另一个适合您需要的库之外还能做些什么。
我希望这能帮上忙!处理依赖问题可能会很忙。

相关问题