question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERESOLVE unable to resolve dependency tree problem with React 18 installed environment

See original GitHub issue

Describe the bug

React 18 was recently released. If you install the TUI Editor after creating a project using create-react-app, the dependency check conflicts as shown below and it is not installed.

It can be fixed temporarily via npm i --force, but it looks like the TUI Editor should properly support React 18.

$ npm i --save @toast-ui/react-editor
npm ERR! code ERESOLVE                                                                    
npm ERR! ERESOLVE unable to resolve dependency tree                                       
npm ERR!                                                                                  
npm ERR! While resolving: my-app@0.1.0                                                    
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\joo\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\joo\AppData\Local\npm-cache\_logs\2022-05-05T04_23_38_878Z-debug-0.log

Below is the full content of eresolve-report.txt:

# npm resolution error report

2022-05-05T04:23:42.386Z

While resolving: my-app@0.1.0
Found: react@18.1.0
node_modules/react
  react@"^18.1.0" from the root project

Could not resolve dependency:
peer react@"^17.0.1" from @toast-ui/react-editor@3.1.5
node_modules/@toast-ui/react-editor
  @toast-ui/react-editor@"*" 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": "18.1.0",
    "whileInstalling": {
      "name": "my-app",
      "version": "0.1.0",
      "path": "D:\\LocalSource\\my-app"
    },
    "location": "node_modules/react",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "prod",
        "name": "react",
        "spec": "^18.1.0",
        "from": {
          "location": "D:\\LocalSource\\my-app"
        }
      }
    ]
  },
  "currentEdge": {
    "type": "prod",
    "name": "react",
    "spec": "^18.1.0",
    "from": {
      "location": "D:\\LocalSource\\my-app"
    }
  },
  "edge": {
    "type": "peer",
    "name": "react",
    "spec": "^17.0.1",
    "error": "INVALID",
    "from": {
      "name": "@toast-ui/react-editor",
      "version": "3.1.5",
      "whileInstalling": {
        "name": "my-app",
        "version": "0.1.0",
        "path": "D:\\LocalSource\\my-app"
      },
      "location": "node_modules/@toast-ui/react-editor",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "prod",
          "name": "@toast-ui/react-editor",
          "spec": "*",
          "from": {
            "location": "D:\\LocalSource\\my-app"
          }
        }
      ]
    }
  },
  "strictPeerDeps": false,
  "force": false
}

To Reproduce

$ npx create-react-app my-app
$ cd my-app
$ npm install --save @toast-ui/react-editor

Expected behavior

The package should install without problems.

Desktop:

  • OS: Windows 10 21H2
  • Browser: Google Chrome 101

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jwlee1108commented, May 11, 2022

We’ll check it. Thank you for the issue.

1reaction
SH-Lee2commented, Aug 29, 2022

I had the same error, but I lowered the react version and solved it. npm install react@^17.0.1 react-dom@17.0.1 and npm i -D @testing-library/react@release-12.x

https://stackoverflow.com/questions/71713405/cannot-find-module-react-dom-client-from-node-modules-testing-library-react

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve dependency tree Reactjs - Stack Overflow
Just run below code. Works fine for me every time. You should also see this solution with the error. npm install --legacy-peer-deps.
Read more >
How to Fix npm ERR ERESOLVE Unable to Resolve ...
How to Fix npm ERR ERESOLVE Unable to Resolve Dependency Tree React Error in Visual ... Now Try To Install Package You Are...
Read more >
unable to resolve dependency tree react 18 - You.com
Describe the bug When running npm install @react-pdf/renderer --save in my project home directory I receive the following error: npm ERR! code ERESOLVE...
Read more >
ERESOLVE Unable To Resolve Dependency Tree - C# Corner
SPFx Install Error. When Installing the SharePoint generator by running the following command. Npm install @microsoft/generator-sharepoint -- ...
Read more >
ERESOLVE unable to resolve dependency tree error [Solved]
The error "npm ERR! ERESOLVE unable to resolve dependency tree" occurs because starting with NPM version 7, NPM tries to install peerDependencies by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found