Reputation: 1
I am getting an error while trying to run the react project using npm start. I have tried to reinstall npm modules and check but it is not working. It gives error as below:
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\Users\91720\Desktop\React js/package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\91720\Desktop\React js\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! C:\Users\91720\AppData\Local\npm-cache_logs\2021-08-30T14_01_45_332Z-debug.log
Upvotes: 0
Views: 845
Reputation: 1
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\91720\AppData\Local\npm-cache_logs\2021-08-30T14_01_45_332Z-debug.log
This error is because you are not in the current directory
TYPE cd{app-name}
Then npm start
Upvotes: 0
Reputation: 2737
Follow the steps below, if you've deleted your package.json
file in your project.
Create a react application again using npx create-react-app {app-name}
in a different folder. Then move to that folder (cd {app-name}
) and check whether package.json
file does exist.
Copy all the files you've created previously into /src
folder of the newly created app.
If you already have the dependencies you used in previously created app, then copy it in dependency section of package.json
file of newly created app.
Run npm install
in application directory.
Check whether npm modules are created again.
If it installed perfectly, then run npm start
to check whether application starts.
Upvotes: 1