Yarn start is not working in my react app

Yarn start is not working in my react app
0

#1

Whenever I run “npm start” and “yarn start” in order to connect to local host but I get the following errors respectively. I have been using “yarn start” and it has been working, but it stoped working when I restarted my system. I am on windows7. Please what do I do? Thanks.


#2

It expects there to be a package.json file (note with some command for start defined) in the directory you’re trying to run it in.

When you type that command, npm or yarn is going to look for the package.json file. In the file, it will look for the start field under scripts, and run whatever the command defined there is. It doesn’t do anything clever - if that file isn’t there nothing will happen. If you try to run it from a different directory for example, the file won’t be there.


#3

The package.json file is there but the command does not recognize it. Please, is there something I should add to the file? What should I do to solve this issue.


#4

Try yarn cache clean, something’s broken, most likely the cache in some way. And update yarn/npm as well, that’s important, it’s not resolving paths correctly if you are definitely in the directory where the package.json file lives.


#5

I have tried that it did not work. So I am starting all over again. Thank you for your time and assistance.:pray::pray::pray: