Skip to content

Angular - Error: Cannot find module 'react/package.json' when build preview #17835

Closed Answered by valentinpalkovic
ihor-panasiuk95 asked this question in Help
Discussion options

You must be logged in to vote

@milenig, @EvanScott542 Please help me to understand the issue. As @shilman pointed out, react and react-dom are necessary peer-dependencies for Storybook. So either your package manager automatically installs them for you, or you must install them manually. We plan to remove these peer-dependencies in Storybook 8.

When Storybook is initiated freshly in a project, Storybook's CLI will automatically install these. Upgrading Storybook from 6 to 7 via npx storybook@latest upgrade should also take care of installing react and react-dom as a peer dependency. If this doesn't happen, you have to add these dependencies manually.

Is there still something unclear? Does the error occur, although react

Replies: 6 comments 17 replies

Comment options

You must be logged in to vote
6 replies
@ihor-panasiuk95
Comment options

@shilman
Comment options

@DerZyklop
Comment options

@niki-04
Comment options

@ziurr
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@HackPoint
Comment options

@tsakalidiskostas
Comment options

@ihor-panasiuk95
Comment options

@ihor-panasiuk95
Comment options

@ihor-panasiuk95
Comment options

You must be logged in to vote
5 replies
@EvanScott542
Comment options

@milenig
Comment options

@valentinpalkovic
Comment options

Answer selected by valentinpalkovic
@valentinpalkovic
Comment options

@valentinpalkovic
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet