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

After executing npx create-react-app my-app it doesn't create the directory structure

Open sinner opened this issue 6 years ago • 9 comments

After executing npx create-react-app my-app it doesn't create the directory and file structure. I only have this:

  • node_modules
  • package.json

sinner avatar Dec 10 '19 04:12 sinner

Same issue.

ashishtechuz avatar Dec 10 '19 05:12 ashishtechuz

I think it's due to an older version installed before. Just uninstall the global installation of create-react-app and after it should work.

Suggestion, this detail should be highlighted in the documentation instead of into a single paragraph.

sinner avatar Dec 10 '19 05:12 sinner

It's still same. uninstalled globally, tried to install using npx. issue isn't resolved yet.

ashishtechuz avatar Dec 10 '19 10:12 ashishtechuz

@ashishtechuz what do you get when you run these following commands? which npm which create-react-app create-react-app --version npx create-react-app --version

joeycozza avatar Dec 10 '19 16:12 joeycozza

@ashishtechuz Have you tried the solution here: #8097

Steve-Reid avatar Dec 10 '19 17:12 Steve-Reid

The fastest way to determine whether you're using a globally installed version or a version higher in your directory tree is to run with the --ignore-existing flag and see if it works. Full command would be npx --ignore-existing create-react-app my-app.

heyimalex avatar Dec 10 '19 18:12 heyimalex

@Steve-Reid this should work, yes.

rwieruch avatar Dec 13 '19 02:12 rwieruch

I'm having the same issue. but npx --ignore-existing create-react-app my-app works for me. But the solution recommended by Steve-Reid didn't

dschlossman avatar Dec 20 '19 15:12 dschlossman

@dschlossman So npx will run without installing because either 1. the binary is installed globally and accessible in the path or 2. the binary is available in some node_modules at or above your current working directory. Calling which create-react-app (or whatever the windows equivalent is) will tell you whether its installed globally, and if it's not you need to find where it is above your path and remove it there.

heyimalex avatar Dec 20 '19 15:12 heyimalex