Storybook: Upgrading from Storybook 4.1.13 to 5.0.0 - Cannot find module '@emotion/core/package.json'

Created on 7 Mar 2019  路  4Comments  路  Source: storybookjs/storybook

Describe the bug

When upgrading from Storybook 4.1.13 to 5.0.0, an attempt to run start-storybook results in the error message Error: Cannot find module '@emotion/core/package.json.

There is no node_modules/@emotion/core folder. The only copy that gets installed is due to the dependencies within @storybook/[email protected], so it's not at the top-level node_modules folder, but instead at node_modules/@storybook/theming/node_modules/@emotion/core.

To Reproduce
Steps to reproduce the behavior:

  1. Start with the following dependencies:
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
  1. Upgrade to Storybook 5:
> yarn remove @storybook/addon-options
> yarn upgrade --latest @storybook/react @storybook/addon-actions 
      @storybook/addon-knobs @storybook/@addon-storyshots
> yarn add --dev --exact @babel/core babel-loader
  1. Attempt to start Storybook
> yarn run start-storybook -- -p 9001

Environment

Windows 10
node 10.15.0
yarn 1.13.0

Additional context
Removing yarn.lock and node_modules and reinstalling purely from the package.json file also fails.

question / support yarn / npm

All 4 comments

Note that installing @storybook/theming fixes the error - is this package now mandatory?

Should not be mandatory. We're still trying to get to the bottom of this -- feels like a yarn bug, but it's all pretty opaque. @emotion/core and @storybook/theming are def in your dependency tree, but they are just not getting hoisted properly AFAIK.

Im getting the exactly same error with npm and package-lock. Error: Cannot find module '@emotion/core/package.json'

Resolving this as a duplicate to https://github.com/storybooks/storybook/issues/5817

We still don't know what's going on tho

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xogeny picture xogeny  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

zvictor picture zvictor  路  3Comments

alexanbj picture alexanbj  路  3Comments

tlrobinson picture tlrobinson  路  3Comments