Running React App?


I am new to React and front end dev, so this question might sound naive, but how do I “run” my react app that I created (using the basic template)?

I installed nvm, npm, and node a couple of days ago. I then created a react template app. I was able to edit the source code and see changes reflected in the localhost website. Then, I closed out of my terminal session, which caused my local host page to lose its connection. Initially I was concerned about the packages (nvm, npm, node) which seemed to have disappeared. Now I think I have them working, so I’m wondering, not how to create a new react app, but how to reconnect a previously created react app to the local host so I can “run” it.

My guess is that this can be done in the command line with something similar to npm start?

Yes indeed, if you had everything set up correctly before, running the command npm start will fetch all your data, complile your existing code and give you a live preview on your local host. Also always check if you have the latest versions on node and npm.

So it looks like I’m missing a package.json? I have that file in the app because it was created with it, but is there anything I need to do manually with the package.json for it to work?

Read the doc.

Thanks! I read that doc before but I must have missed the part about opening the app file before running it.

Yes check the documentation and see what you might have missed.
Happy coding !