2

Could not resolve dependency:

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^16.14.0" from the root project
npm ERR!   peer react@"*" from [email protected]
npm ERR!   node_modules/react-native-typography
npm ERR!     react-native-typography@"^1.4.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@"*" from [email protected]
npm ERR!   node_modules/react-native-typography
npm ERR!     react-native-typography@"^1.4.1" 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\admin\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\admin\AppData\Local\npm-cache\_logs\2022-04-06T06_23_11_824Z-debug-0.log

this text from log

127 verbose stack Error: unable to resolve dependency tree 127 verbose stack at Arborist.[failPeerConflict] (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1398:25) 127 verbose stack at Arborist.[loadPeerSet] (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1391:30) 127 verbose stack at async Arborist.[loadPeerSet] (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1332:11) 127 verbose stack at async Arborist.[buildDepStep] (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:950:11) 127 verbose stack at async Arborist.buildIdealTree (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:216:7) 127 verbose stack at async Promise.all (index 1) 127 verbose stack at async Arborist.reify (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:153:5) 127 verbose stack at async Install.exec (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\lib\commands\install.js:156:5) 127 verbose stack at async module.exports (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\lib\cli.js:66:5)

and this is error report.txt

While resolving: [email protected]
Found: [email protected]
node_modules/react
  react@"^16.14.0" from the root project
  peer react@"*" from [email protected]
  node_modules/react-native-typography
    react-native-typography@"^1.4.1" from the root project

Could not resolve dependency:
peer react@"17.0.2" from [email protected]
node_modules/react-native
  peer react-native@"*" from [email protected]
  node_modules/react-native-typography
    react-native-typography@"^1.4.1" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "react",
    "version": "16.14.0",
    "whileInstalling": {
      "name": "webmin-react",
      "version": "0.1.1",
      "path": "F:\\Download's\\react\\webmin-react"
    },
    "location": "node_modules/react",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "prod",
        "name": "react",
        "spec": "^16.14.0",
        "from": {
          "location": "F:\\Download's\\react\\webmin-react"
        }
      },
      {
        "type": "peer",
        "name": "react",
        "spec": "*",
        "from": {
          "name": "react-native-typography",
          "version": "1.4.1",
          "whileInstalling": {
            "name": "webmin-react",
            "version": "0.1.1",
            "path": "F:\\Download's\\react\\webmin-react"
          },
          "location": "node_modules/react-native-typography",
          "isWorkspace": false,
          "dependents": [
            {
              "type": "prod",
              "name": "react-native-typography",
              "spec": "^1.4.1",
              "from": {
                "location": "F:\\Download's\\react\\webmin-react"
              }
            }
          ]
        }
      }
    ]
  },
  "currentEdge": {
    "type": "prod",
    "name": "react",
    "spec": "^16.14.0",
    "from": {
      "location": "F:\\Download's\\react\\webmin-react"
    }
  },
  "edge": {
    "type": "peer",
    "name": "react",
    "spec": "17.0.2",
    "error": "INVALID",
    "from": {
      "name": "react-native",
      "version": "0.68.0",
      "whileInstalling": {
        "name": "webmin-react",
        "version": "0.1.1",
        "path": "F:\\Download's\\react\\webmin-react"
      },
      "location": "node_modules/react-native",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "peer",
          "name": "react-native",
          "spec": "*",
          "from": {
            "name": "react-native-typography",
            "version": "1.4.1",
            "whileInstalling": {
              "name": "webmin-react",
              "version": "0.1.1",
              "path": "F:\\Download's\\react\\webmin-react"
            },
            "location": "node_modules/react-native-typography",
            "isWorkspace": false,
            "dependents": [
              {
                "type": "prod",
                "name": "react-native-typography",
                "spec": "^1.4.1",
                "from": {
                  "location": "F:\\Download's\\react\\webmin-react"
                }
              }
            ]
          }
        }
      ]
    }
  },
  "strictPeerDeps": false,
  "force": false
}

1 Answer 1

0

Looks like react-native had not updated its peer-dependency of react yet from 17x to 18x. If you take a look at this comment then you'll see it's done now. So try installing again because now it should work.

And if it doesn't you can always use the force flag. But only use this flag as a last resort.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.