Storybook: Cannot run `npm update` on [email protected] due to storybook's peer dependency

Created on 28 Oct 2020  ·  7Comments  ·  Source: storybookjs/storybook

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"
},

react dependencies question / support

All 7 comments

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!

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?

Please upgrade to 6.1 alpha which should be react 17 compatible

npx sb upgrade --prerelease

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

welled tried npm 7.0.11, still the same.

Also having this issue, with NPM version 7.1.1.

AFAIK we're blocked on this: https://github.com/reach/router/pull/436

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

Was this page helpful?
0 / 5 - 0 ratings