Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a homepage field to package.json in react app not translating to build

Tags:

reactjs

build

I'm trying to launch a React app (create-react-app) to GoDaddy using cPanel and I am having issues creating the correct build. I am setting the homepage in package.json underneath "name" and "version" (not sure if order matters here) like this:

"homepage": "http://mydomainname.org"

However, when I run npm run build, I get a message saying "The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json.

Has anyone encountered this problem before?

like image 367
KayCoder Avatar asked Dec 09 '25 06:12

KayCoder


1 Answers

That message is not an error. After you run the npm run build command a folder named build should appear and it contains your react app. You need to upload the contents of that folder to the public_html folder in cpanel's file manager. (Make sure you are uploading what is inside the build folder and not the build folder itself). Here is a link to a short tutorial

like image 167
Raymond Mutyaba Avatar answered Dec 11 '25 22:12

Raymond Mutyaba