React-app is not starting

Hallo,
I am in Lesson 10 “Building images“ and receive the folloing error message while starting the react app with the command “npm start”. see screenshot.
what went wrong? what can I do to solve the problem — any suggestions?
Looking forward hearing from you

Freddie

Hi,
This is weird.
The structure of a React project is (amongst others)

  • Project folder
    • src
    • packages.json

You must type npm start from the place where the packages.json is located.
Now it looks your packages.json is within the src folder…

Did you do the npm install step prior to start ?

Cheers.

Hi,
Thank you for your answer and concern.
I installed npm again, started npm and received the following messages see screenshot


Freddie

Did you try the steps given ?

HMM I just start now

hello,
no success have a similar error message


Freddie

What should you npm start from the parent folder react-app?

Hallo,

did i get you right, that is important to have various files in the “right” directory?
please see screenshot attached

Freddie

Well I do not have such expertise to tell where is the “right” place.
That said I have the expertise of having worked with a few React projects.
Always the package.json is under the project folder at the same level as src folder.

Just one example of a project of mine.
image

From that point of view something seems off in your project. I can’t tell if it is really.

I always used create-react-app to scaffold a project. Be sure to use npx command instead of npm for that operation.

This is part of the official docs.

npx create-react-app my-app

Good Luck

Hi,

Thank you for your concern and suggestions!

Freddie

Hallo
I am happy I tried your suggestions and it works!!
THANK YOU!!

1 Like