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

Cannot run npm update on [email protected] due to storybook's peer dependency #12939

Closed
xiaoshuw opened this issue Oct 28, 2020 · 10 comments
Closed

Comments

@xiaoshuw
Copy link

Describe the bug
After upgrading npm to [email protected], npm update

To Reproduce

  1. Go to a storybook project
  2. run npm install -g [email protected] (any npm 7 version seems the same)
  3. npm update

Expected behavior
Should update the projects.

But it shows:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: root@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! peer react@"^16.8.0" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-essentials
npm ERR! dev @storybook/addon-essentials@"^6.0.27" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from [email protected]
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@"*" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-essentials
npm ERR! dev @storybook/addon-essentials@"^6.0.27" 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 /Users/xiaoshuw/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xiaoshuw/.npm/_logs/2020-10-28T18_57_59_771Z-debug.log

I am guessing it is due to the "react-dom":"*" on the addon-essentials

"peerDependencies": {
"babel-loader": "^8.0.0",
"react": "^16.8.0",
"react-dom": "*",
"react-is": "^16.8.0"
},

@davidprae
Copy link

I'm getting a similar error just trying to install Storybook with "react": "17.0.1"

• Detecting project type. ✓
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!   peer react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-essentials
npm ERR!   dev @storybook/addon-essentials@"^6.0.27" 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!

@strass
Copy link

strass commented Oct 29, 2020

I'm hitting the same issue. If I use --legacy-peer-deps I can install packages but afterwards my react storybook ends up being detected as an @storybook/angular project?

@shilman
Copy link
Member

shilman commented Nov 1, 2020

Please upgrade to 6.1 alpha which should be react 17 compatible

npx sb upgrade --prerelease

@hiepxanh
Copy link

it is not the bug by storybook it-self, please install new version of NPM by running npm i -g [email protected]
since that it causing by this bug in npm (bug)[https://github.com/npm/cli/issues/2134]
BTW: we should not test with npm@7 or yarn@2 it very unstable and causing crazy issues

@xiaoshuw
Copy link
Author

welled tried npm 7.0.11, still the same.

@rsispal
Copy link

rsispal commented Dec 10, 2020

Also having this issue, with NPM version 7.1.1.

@shilman
Copy link
Member

shilman commented Dec 10, 2020

AFAIK we're blocked on this: reach/router#436

If you're reading this comment, please go upvote that PR to let them know it's important 🙏

@antoniosZ
Copy link

hasn't reach/router been absorbed by react-router?

https://reacttraining.com/blog/reach-react-router-future/
https://reach.tech/router/

perhaps migrate to the latest react-router?
I think it will also solve #11928

@viridia
Copy link

viridia commented Mar 17, 2021

I've stopped using reach/router in my own projects since it appears to be abandoned. I've used react-router in some projects but it's pretty hefty compared to other alternatives.

I tried several different routers, wouter looks to be a reasonable and small replacement that wasn't too difficult to migrate to.

@ndelangen
Copy link
Member

This issue is resolved in storybook 7.0 beta.

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

9 participants