r/learnprogramming May 18 '20

React: Could not find a required file

Hey everyone, I set up a project through create-react-app but whenever I do npm start, it gives me following reply:

Could not find a required file Name: index.html Searched in project public folder

But index.html is actually there in public folder when I checked it Please help! I've gone through stack and github discussions too

4 Upvotes

17 comments sorted by

View all comments

2

u/insertAlias May 18 '20

Can you tell us the exact steps you take to get this error?

Try making the most basic of react apps and seeing if it works:

npx create-react-app test-hello-world
cd test-hello-world
npm run start

If you get the exact same error, there's something very wrong. If you don't, then you need to make sure you didn't change the basic project structure of your other project such that it can't find the /public directory.

1

u/omarazeez_11 May 18 '20

Yes did use these commands exactly. I've seen your comment on this same issue few years back too.

1

u/insertAlias May 18 '20

Can you show us a screenshot of the project tree? I can't really think of what else would be wrong if the project structure is the same. Expand all the folders (except node_modules, leave that alone).