Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
90
rated 0 times [  97] [ 7]  / answers: 1 / hits: 41147  / 6 Years ago, mon, april 9, 2018, 12:00:00

I set up a create-react-app and I'm trying to run App.js on localhost, but upon doing yarn start I get the following error message:



22:23 $ yarn start
yarn run v1.3.2
$ react-scripts start
Could not find a required file.
Name: index.html
Searched in: /Users/-----/Desktop/---/----/hw/HW-REPO/hw-name/public
error Command failed with exit code 1.


I'd already installed yarn with yarn install, so I'm not sure if there's something wrong with my code or with the file structure.



Here's the file structure:



app-name
-client
--public
---index.html
---manifest.json
--src
---Components
----various folders
---App.js
---App.test.js
---index.js
-database
-model
-gitignore
-package-lock.json
-package.json
-server.js
-yarn.lock

More From » reactjs

 Answers
47

Update: I moved yarn.lock and package.json into the client folder, did yarn install again, and then ran yarn start. Now I'm seeing good ol' error messages in the browser. I'm not 100% sure if shuffling the files around did the trick or if it was doing yarn install again, but at least it's working now.


[#54719] Friday, April 6, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alorac

Total Points: 262
Total Questions: 82
Total Answers: 97

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
alorac questions
Sat, Oct 10, 20, 00:00, 4 Years ago
Tue, Sep 22, 20, 00:00, 4 Years ago
Wed, Jul 1, 20, 00:00, 4 Years ago
Wed, Jun 3, 20, 00:00, 4 Years ago
Sun, May 17, 20, 00:00, 4 Years ago
;