Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERESOLVE unable to resolve dependency tree - missing support for [email protected] #15776

Closed
jhohlfeld opened this issue Aug 6, 2021 · 5 comments

Comments

@jhohlfeld
Copy link

Describe the bug
Project cannot be run if [email protected] is the only react dependency.

When running npm install, I get the following error:

% npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@"^16.8.0 || ^17.0.0" from @storybook/[email protected]
npm ERR!   node_modules/@storybook/react
npm ERR!     dev @storybook/react@"^6.3.6" from the root project
npm ERR!   7 more (react-dom, @storybook/addons, @storybook/core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/[email protected]
npm ERR! node_modules/@storybook/api/node_modules/@reach/router
npm ERR!   @reach/router@"^1.3.4" from @storybook/[email protected]
npm ERR!   node_modules/@storybook/api
npm ERR!     @storybook/api@"6.3.6" from @storybook/[email protected]
npm ERR!     node_modules/@storybook/addons
npm ERR!       @storybook/addons@"6.3.6" from @storybook/[email protected]
npm ERR!       node_modules/@storybook/react
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 /Users/jakob/.npm/eresolve-report.txt for a full report.

To Reproduce
Copy and paste this package.json and run npm install:

{
  "name": "repro",
  "scripts": {
    "storybook": "start-storybook -p 6006"
  },
  "devDependencies": {
    "@babel/core": "^7.15.0",
    "@storybook/react": "^6.3.6",
    "babel-loader": "^8.2.2",
    "typescript": "^4.3.5"
  },
  "dependencies": {
    "react": "^17.0.2"
  }
}

System
Please paste the results of npx sb@next info here.

% npx sb@next info

Environment Info:

  System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  Binaries:
    Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 7.11.2 - ~/.nvm/versions/node/v16.1.0/bin/npm
  Browsers:
    Chrome: 92.0.4515.131
    Firefox: 85.0
    Safari: 14.1.1

Additional context
Add any other context about the problem here.

Adding react@16 to package.json seems to work.

@HassenHichri
Copy link

We run into the same problem, it looks like the problem coming from reach-router as a dependency of @storybook/api https://github.com/reach/router/blob/master/package.json

@kaiyoma
Copy link

kaiyoma commented Sep 23, 2021

Lots of others are running into this problem as well. Storybook 6.4 is supposed to be fixing this by removing the offending dependency. More discussion here: #14619

@brianpmaher
Copy link

Any update on this? I'm running into this same issue.

@shilman
Copy link
Member

shilman commented Mar 1, 2022

@brianpmaher what version of storybook are you using? In 6.4 we moved from reach router to react-router and in 6.5, we're prebundling the router so that it should be invisible to the user.

# to try 6.4
npx sb upgrade

# to try 6.5
npx sb upgrade --prerelease

Closing this for now since I believe it's already fixed. If not, happy to re-open.

@shilman shilman closed this as completed Mar 1, 2022
@brianpmaher
Copy link

Ah I was on 6.3, but after upgrading to 6.4 I'm no longer seeing this issue. Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants