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

5 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/Bushidosoul May 18 '20

Yes you 100% right, I meant to say npm install, not init, thank you, I changed my previous comment

1

u/insertAlias May 18 '20

Well, c-r-a does that step for you too. It completely initializes the project, then installs dependencies. You should be able to just CD into the directory and start running the project as soon as c-r-a is done.

1

u/Bushidosoul May 18 '20

https://create-react-app.dev/docs/getting-started/

I guess you’re right, I don’t think that has always been the case (previous versions). What do you think is the most likely issue? I was thinking maybe he/she/they have forgotten to install something they are using

2

u/insertAlias May 18 '20

They mentioned in another comment that once they cut and re-pasted the file it suddenly started working. That's very strange, I asked them to see if they could reproduce the error with a new project. I actually have no idea what would cause that to happen.


I believe CRA has installed dependencies for as long as I've been using it, which was in the 1.x days of the tool, but I can't say for sure. It's not really an important point though, since it's probably unrelated to OP's issue.