skip to Main Content

npm error code ENOENT
npm error syscall open
npm error path C:Usersapackage.json
npm error errno -4058
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘C:Usersapackage.json’
npm error enoent This is related to npm not being able to find a file.
npm error enoent

npm error A complete log of this run can be found in: C:UsersaAppDataLocalnpm-cache_logs2024-07-11T16_49_41_924Z-debug-0.log

To creat a react project

Inside that directory, you can run several commands:

npm start
Starts the development server.

npm run build
Bundles the app into static files for production.

3

Answers


  1. Chosen as BEST ANSWER

    install create-react-app globally:


    npm install -g create-react-app

    Now you can run:

    create-react-app project-name


  2. To create a React project using create-react-app command, you should first navigate to the directory where you want to create the project and then run the command.

    you should insert command on the cmd termial box what you want to create folder.

    cd C:Usersa

    npx create-react-app my-react-app
    
    Login or Signup to reply.
  3. It is recommended now to create react apps using vite instead of create-react-app because it is much faster.
    To do so, you need to run the command:

    npm create vite@latest my-react-app --template
    

    where my-react-app is the name of your project

    then you will get the following:

    enter image description here

    after you choose react you will need to choose between typescript and
    Javascript

    enter image description here

    And then your project is ready.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search