create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Found: react@undefined when run npx create-react-app

Open klezd opened this issue 4 years ago • 6 comments
trafficstars

Describe the bug

Found: react@undefined
node_modules/react
  react@"*" from the root project

Could not resolve dependency:
peer react@"17.0.2" from [email protected]
node_modules/react-dom
  react-dom@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Error when running with create-react-app.

I have tried on an exisiting project to install package @material-ui and received similiar result as above (Found react@undefined)

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

Environment Info:

  current version of create-react-app: 4.0.3
  running from C:\Users\sienn\AppData\Roaming\npm\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
  Binaries:
    Node: 16.3.0 - ~\AppData\Roaming\npm\node.CMD
    Yarn: Not Found
    npm: 7.18.1 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.18362.449.0)
    Internet Explorer: 11.0.18362.1
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. npx create-react-app my-app

Expected behavior

Successfully created React App

Actual behavior

image

klezd avatar Jun 22 '21 12:06 klezd

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jan 09 '22 16:01 stale[bot]

Screenshot (409) I just had it now!

Psalmcee avatar Jul 14 '22 22:07 Psalmcee

I'm also getting this error when trying to install react v18.2.2

christroutner avatar Jul 27 '22 22:07 christroutner

In case this helps anyone, I had this issue as well. It turned out to be a problem with my local npm cache. Try this:

npm cache clean --force

Everything worked for me afterward.

npm cache docs: https://docs.npmjs.com/cli/v7/commands/npm-cache

From the docs for npm cache clean:

Delete all data out of the cache folder. Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues.

Well, sometimes it's necessary I guess. 🙂

cjseattle avatar Aug 15 '22 23:08 cjseattle

Nope It's not working for me. I have tried following thing as well to clean up all cache stuff.

npm cache clean --force

npm config rm proxy

npm config rm https-proxy

npm cache verify

Still facing same issue. for reference adding ss.

Screenshot 2023-03-04 at 9 35 37 AM

patilhitendra avatar Mar 04 '23 04:03 patilhitendra