Make sure there is no other configuration file (beside package.json) which would still reference the old GitHub repository URL. Check your git config -l.
After your git init, make sure to make at least one new commit, and push to the corresponding new GitHub repository.
» npm install gh-pages
Videos
» npm install gh-pages-deploy
You need to install gh-pages globally by adding "-g":
npm install -g gh-pages
and then
npm run deploy
Docs: https://docs.npmjs.com/downloading-and-installing-packages-globally
You need install gh-pages before running deploy, run:
npm install --save-dev gh-pages
then
npm run deploy
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>orhttp(s)://<organization>.github.io/<repository>.
TRY THE FOLLOWING STEPS
- create a new github Repository
- Inititialize git in your project folder by running command "git init"
- create a .gitignore file and add your npm modules in it
- run command
git add - run command
git commit -m "added files" - run command
git remote add origin [email protected]:username/new_repo - run command
git push - 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
I found out that you don't need the build script or the pre-deploy script. they are unnecessary to be used, since my website is static, I can navigate directly to the build folder and it will work fine.
I have modified the config.json file to be as in the following
{
"name": "AmrAhmed",
"version": "1.0.0",
"description": "",
"main": "truffle.js",
"directories": {
"test": "test"
},
"scripts": {
"dev": "lite-server",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "gh-pages -d src"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gh-pages": "^3.0.0",
"lite-server": "^2.5.4"
}
}
run the command
npm run build
and it will be deployed to Github pages.
you should also add "homepage":"https://yourGithub.github.io/your-repo" above "name" in the package.json

So I run this command npm install --save gh-pages
like below

After that I run the command npm run deploy
My code published successfully like below.

For more details just follow this link by Facebook which is given below.
(https://facebook.github.io/create-react-app/docs/deployment#github-pages-https-pagesgithubcom)
I hope your issue will be resolved. In case of error please reply.
please install gh-pages and it ready to go
To install
npm install gh-pages
to deploy
add this to package.json
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
and then this
npm run deploy