Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 5

I can't deploy React app to github pages

Solved! Go to Solution.

I'm trying since 3 days to deploy my react app on Github pages.

 

I followed the steps of this:

https://dev.to/yuribenjamin/how-to-deploy-react-app-in-github-pages-2a1f

 

it builds, but woudnt push to github.

 

resume@0.1.0 deploy /home/zsuzsa/Asztal/Projects/resume
> gh-pages -d build

Cloning into 'node_modules/gh-pages/.cache/git@github.com!ZsuzsaMano!ZsuzsaMano.github.io'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! resume@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the resume@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output abov
e.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/zsuzsa/.npm/_logs/2019-11-17T18_13_43_540Z-debug.log

 

then after a lot of different trys I tried to just drag the build folder to my repo, after the 3rd time, it finally worked.

I set githubpages in settings, but on

https://zsuzsamano.github.io/Resume/          I still only get Error  404

 

https://github.com/ZsuzsaMano/Resume is my repo.

 

Im already quite desperate.... greatful for any ideas

 

Im using Ubuntu 16.04 and Atom

 

 

4 Replies
Highlighted
Solution
Copilot Lvl 2
Message 2 of 5

Solved

I change ssh to https in package.json homepage

That made the magic.

 

Highlighted
Ground Controller Lvl 1
Message 3 of 5

Re: Solved

Having the same issue but I have https for the homepage already


@ZsuzsaMano wrote:

I change ssh to https in package.json homepage

That made the magic.

 


 

Highlighted
Ground Controller Lvl 1
Message 4 of 5

Re: Solved

I solved the issue by changing SSH connection to HTTPS,

remove SSH origin and add HTTPS, worked for me

Highlighted
Ground Controller Lvl 1
Message 5 of 5

Re: Solved

Unacceptable.  I see plenty of developers not having to switch over to https and getting this to work.  I don't want to have to keep putting my username and password in every time I'm deploying.  

 

I just solved this problem...

 

If you use a passphrase for git authentication then this solution might work for you.  I wrote this answer on StackExchange.  Check it out here: https://superuser.com/questions/1435950/git-gh-pages-deployment-permissions-error-permission-denied-...