-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Description
Describe the bug
Storybook Installation Bug Report
Issue Summary
npm create storybook@latest
fails with ERESOLVE dependency conflict when trying to install Storybook in a React Native/Expo project.
Environment
- OS: macOS 14.5.0 (darwin 24.5.0)
- Node.js: (run
node --version
to check) - npm: (run
npm --version
to check) - Project Type: Expo React Native
- Expo SDK: ~53.0.17
- React Native: 0.79.5
- React: 19.0.0
Steps to Reproduce
- Create a fresh Expo project
- Run
npm create storybook@latest
- Select "Recommended: Component dev, docs, test"
- Select "Both: Add both native and web Storybooks"
Expected Behavior
Storybook should install successfully with compatible versions of all packages.
Actual Behavior
Installation fails with the following error:
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/storybook
npm ERR! dev storybook@"^9.0.16" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer storybook@"9.0.14" from @storybook/[email protected]
npm ERR! node_modules/@storybook/addon-ondevice-controls
npm ERR! dev @storybook/addon-ondevice-controls@"^9.0.14" from the root project
Root Cause
Version mismatch between:
- Core Storybook package:
9.0.16
- React Native addons:
9.0.14
The React Native addons (@storybook/addon-ondevice-controls
, @storybook/addon-ondevice-actions
, etc.) have not been updated to match the latest Storybook version.
Attempted Workarounds
- Using legacy peer deps flag:
npm create storybook@latest --legacy-peer-deps
- Failed (flag not recognized) - Manual installation: Installing specific versions manually works but requires extra steps
Suggested Solutions
- Update React Native addons to version 9.0.16 to match core Storybook
- Lock create-storybook to install compatible versions together
- Add better error handling in create-storybook to suggest version-specific installation
Package Versions Involved
[email protected]
(latest)@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
Additional Context
This appears to be a timing issue where the core Storybook package was updated but the React Native ecosystem packages weren't updated simultaneously.
Temporary Fix
Users can work around this by:
- Using
npm create [email protected]
to install the older compatible version - Manually installing packages with
--legacy-peer-deps
flag - Using
--force
flag when encountering the dependency conflict
Reproduction link
https://github.com/brandtnewlabs/expo-nativewind-storybook
Reproduction steps
- npx create-expo-app@latest
- npm create storybook@latest
System
Storybook Environment Info:
System:
OS: macOS 15.5
CPU: (14) arm64 Apple M4 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm <----- active
pnpm: 8.7.6 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 138.0.7204.101
Safari: 18.5
Additional context
No response
dosubot