question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'react/package.json'

See original GitHub issue

Describe the bug npm run storybook Cannot find module ‘react/package.json’

To Reproduce Steps to reproduce the behavior:

npm init
npx -p @storybook/cli sb init --type react
npm run storybook

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

36reactions
Jack-Aaroncommented, Dec 15, 2021

Also need to have react-dom installed as a dev dependency.

22reactions
RyderKishancommented, Jul 18, 2021

Check if you have added react as part of peer dependencies. It has to be there in dependencies also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'react' - Stack Overflow
Your package.json doesn't have React in it. It's pretty hard for your project to use a package you haven't installed. Just add: "react":...
Read more >
npm run storybook blocked by "Cannot find module 'react ...
I cannot run `npm run storybook`. And this is the message I got: ... Error: Cannot find module 'react/package.json' ERR! Require stack: ERR!...
Read more >
Cannot find module 'react' Error in TypeScript | bobbyhadz
To solve the "Cannot find module react or its corresponding type declarations" error, install the module and its type definitions by running the...
Read more >
Fix - Cannot find module 'react' error - Reactgo
The can't find module 'react' error occurs, if you're trying to access a react module that is not currently installed in your project....
Read more >
Error "Cannot find module 'react' or its corresponding type ...
If the error is not resolved, try to delete your node_modules and package-lock.json files, re-run npm install and restart your IDE. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found