0

I want to make a react project but when I execute npx create-react-app, it doesn't respond. Can anyone tell me what the issue I am facing here is? Screenshot.

edddd
  • 433
  • 3
  • 17
  • check you node and npm versions: `node -v` and `npm -v` on my machine with: node v14.17.0 and npm 6.14.13 >> `npx create-react-app visual` works without any issue. – robert Sep 18 '21 at 15:57

2 Answers2

0

make an empty folder then drag it over VSC, and type in terminal: npx create-react-app . (dot means in the current folder) also make sure u have node installed, type: node -v (to check what version u have)

codmitu
  • 636
  • 7
  • 9
0

From the official ReactJS Docs:

You’ll need to have Node >= 14.0.0 and npm >= 5.6 on your machine. To create a project, run:

npx create-react-app my-app
cd my-app
npm start

In the screenshot you provided, you indeed ran the command; but, it doesn’t show that you checked that the directory, visual, was created within your working directory, New folder. In addition, no error message was output; so as it stands, we know the npx command exists; and can only assume that, the command executed without error.

When using create-react-app:

  1. A new directory will be created in the working directory (in your case, New folder) you run the command within.
  2. This new directory will have the name of the argument you provided to create-react-app (in your case, visual).
  3. So your directory structure you look like this:
    New folder/
      └─ visual/
    

The issue I see is that, the general output normally seen when running create-react-app (as shown here) did not appear in your screenshot; however, I’ve never ran it from MS PowerShell, as you appear to be. So you’ll want to check:

  • That you’re not overthinking this, and ensure that the, my-app, folder really wasn’t created;
  • And that your NodeJS version is either 14.0.0 or higher:
    node -v
    
  • And that create-react-app was not installed globally:
    • To check this, run:
      npm list -g
      
    • If you see create-react-app in the list, run:
      npm uninstall -g create-react-app
      npm install create-react-app
      
  • Or that running it from cmd (or cygwin) instead of powershell is maybe the better option.