Home > Software design >  How can I create a react app using react js?
How can I create a react app using react js?

Time:07-05

I am new to backend and I am having issues creating react app.

I have started fresh multiple times and create a brand new terminal which I cd in a folder named "client".

As I type npx create-react-app./ I get this error:

    ritamiranda@Ritas-MacBook-Air new project % cd client
    ritamiranda@Ritas-MacBook-Air client % npx create-react-app./
    npm ERR! code ENOENT
    npm ERR! syscall open
    npm ERR! path /Users/xxx/Desktop/new project/client/create-react-app./package.json
    npm ERR! errno -2
    npm ERR! enoent ENOENT: no such file or directory, open '/Users/ritamiranda/Desktop/new project/client/create-react-app./package.json'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent 

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/xxx/.npm/_logs/2022-07-04T18_25_05_983Z-debug-0.log
    ritamiranda@Ritas-MacBook-Air client % cd [client]
    zsh: no matches found: [client]
    ritamiranda@Ritas-MacBook-Air client % npm create react app
    npm ERR! could not determine executable to run

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/ritamiranda/.npm/_logs/2022-07-04T18_26_41_818Z-debug-0.log
    ritamiranda@Ritas-MacBook-Air client % 

please help, thank you!

CodePudding user response:

Creating a React Project

I believe you're actually missing naming your app.

To create a project, navigate to the folder where you want to store the project and from the terminal run:

npx create-react-app my-app

Instead of my-app make sure to choose whatever name you want to call your project.

CodePudding user response:

You can create a project with Vite. It is faster than the comparatively traditional way. You can run the below code in your terminal.

 npm create vite@latest myapp
  • Related