Skip to content

[Bug]: Expo Storybook Installation Bug Report #32015

@brandtnewlabs

Description

@brandtnewlabs

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

  1. Create a fresh Expo project
  2. Run npm create storybook@latest
  3. Select "Recommended: Component dev, docs, test"
  4. 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

  1. Using legacy peer deps flag: npm create storybook@latest --legacy-peer-deps - Failed (flag not recognized)
  2. Manual installation: Installing specific versions manually works but requires extra steps

Suggested Solutions

  1. Update React Native addons to version 9.0.16 to match core Storybook
  2. Lock create-storybook to install compatible versions together
  3. Add better error handling in create-storybook to suggest version-specific installation

Package Versions Involved

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:

  1. Using npm create [email protected] to install the older compatible version
  2. Manually installing packages with --legacy-peer-deps flag
  3. Using --force flag when encountering the dependency conflict

Reproduction link

https://github.com/brandtnewlabs/expo-nativewind-storybook

Reproduction steps

  1. npx create-expo-app@latest
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions