0

so i was following a Youtube tutorial on how to deploy react apps to github , and i followed these steps: 1-npm install gh-pages --save-dev 2-created a repo in github 3-git remote add origin https://github.com/alisliim/Eurikso-Mobility-Academy.git 4- added "homepage" : "https://github.com/alisliim/Eurikso-Mobility-Academy" "predeploy": "npm run build" "deploy": "gh-pages -d build" in the jason file BUT when i run the npm run deploy command it doesnt work and i get this error: This is a screen shot of the error since i couldnt copy it Please any help is appriciated

2 Answers 2

1

Try setting "homepage": "http://alisliim.github.io/Eurikso-Mobility-Academy"

because "homepage" means site URL and not repository URL.

from GitHub Docs:

The source files for a project site are stored in the same repository as their project. Unless you're using a custom domain, project sites are available at http(s)://<user>.github.io/<repository> or http(s)://<organization>.github.io/<repository>.

Sign up to request clarification or add additional context in comments.

1 Comment

could you explain why that works? this is better off as a comment rather than an answer
0

TRY THE FOLLOWING STEPS

  1. create a new github Repository
  2. Inititialize git in your project folder by running command "git init"
  3. create a .gitignore file and add your npm modules in it
  4. run command git add
  5. run command git commit -m "added files"
  6. run command git remote add origin [email protected]:username/new_repo
  7. run command git push
  8. By that all your files would have been uploaded successfully on github then you can decide to host it using heroku or any other hosting platform

If you have any issues on it, please let me know

3 Comments

i did not understand the 3rd step can you please repeat what do you mean and how and where should i find these npm files and where i should create this .gitignore file ? thank you
in your project directory, run the command "touch .gitignore" with no extensions
and then this as three different lines in it 1. .node_modules 2. node_modules/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.