Avatar of Jimbo99999
Jimbo99999
Flag for United States of America asked on

Help with running my Node project

Hello experts.  I am having some trouble running one of the group projects we created in our bootcamp.  If I may, describe the issue and can you recommend which additional files to attach to help with the detective work?

This was a working project that we presented(it was on a different laptop than mine).  I pulled it down from Github onto my laptop.  I worked through a few roadblocks and I do have it running on my localhost. Unfortunately, the html page that is loaded is blank.  When I open the html file in a Sublime  there is no markup in it.  I attached the index.html file.  There are comments in it I do not understand.  I was responsible for the backend while another team member took care of the frontend

1)
Here is what I have in the server.js file for the html page:

app.get(function(req, res) {
   res.sendFile(path.join(__dirname, "./client/public/index.html"));
});

2)
I attached a screen print of the browser console when the index.html file opens empty.







Thank you for your patience and help,
Ed
Web DevelopmentHTMLJavaScript

Avatar of undefined
Last Comment
Jimbo99999

8/22/2022 - Mon
Chris Stanyon

Generally, when writing a Node app, you create the source files, and then you 'build' your application. The build process is responsible for compiling all of your assets into usable files, and injecting them into the index file. Often, the built assets will be placed in a specific folder such as 'dist' or 'build'

You run the build process by running one of the scripts available in your package.json file such as dev, build, test etc:

npm run build

Generally, there is also a dev script to allow you to launch a server for testing:

npm run dev
Jimbo99999

ASKER
Thank you. I will try tonight.
Jimbo99999

ASKER
Hello

I did not have much luck.  I do not understand why there are 2 package.json files.  

There is one in the same location as my server.js file.  I  navigated in Bash to the path where server.js file is located. When I type node server.js and then check localhost that is when I get the blank screen.  

Then up one level in the client folder there is another one.
So, in light of finding the second package.json file, I navigated in Bash into the client folder.  Then tried npm run start and received message " 'react-scripts' is not recognized as an internal or external command".  

Can you offer suggestions on what to try next?  

Thanks,
Ed
package.json
package.json
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Chris Stanyon

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jimbo99999

ASKER
Thank you for the help. It is working now!