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
install create-react-app globally:
npm install -g create-react-app
Now you can run:
create-react-app project-name
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.
It is recommended now to create react apps using
vite
instead ofcreate-react-app
because it is much faster.To do so, you need to run the command:
where
my-react-app
is the name of your projectthen you will get the following:
after you choose
react
you will need to choose betweentypescript
andJavascript
And then your project is ready.