Hello! I am trying to put my React projects on Github Pages with npm run deploy. Everything goes fine with the first stages of npm run build and react scripts build. But then when it gets to this part it fails:
> gh-pages -d build Cloning into 'C:\Users\User\path\to\file\react-drum-pad\node_modules\.cache\gh-pages\firstname.lastname@example.org!EdenSweden!react-drum-pad.git'... email@example.com: 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! firstname.lastname@example.org deploy: `gh-pages -d build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the email@example.com deploy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-09-11T22_47_38_527Z-debug.log
When I try to debug my ssh key by entering ‘ssh -vT firstname.lastname@example.org’, it prints this:
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 debug1: Connecting to github.com [IP address] port 22. debug1: Connection established. debug1: identity file C:\\Users\\User/.ssh/id_rsa type 0 debug1: identity file C:\\Users\\User/.ssh/id_rsa-cert type -1 debug1: identity file C:\\Users\\User/.ssh/id_dsa type -1 debug1: identity file C:\\Users\\User/.ssh/id_dsa-cert type -1 debug1: identity file C:\\Users\\User/.ssh/id_ecdsa type -1 debug1: identity file C:\\Users\\User/.ssh/id_ecdsa-cert type -1 debug1: identity file C:\\Users\\User/.ssh/id_ed25519 type -1 debug1: identity file C:\\Users\\User/.ssh/id_ed25519-cert type -1 debug1: identity file C:\\Users\\User/.ssh/id_xmss type -1 debug1: identity file C:\\Users\\User/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1 debug1: Remote protocol version 2.0, remote software version babeld-e995f6d1 debug1: no match: babeld-e995f6d1 debug1: Authenticating to github.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: rsa-sha2-512 debug1: kex: server->client cipher: email@example.com MAC: <implicit> compression: none debug1: kex: client->server cipher: firstname.lastname@example.org MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ssh-rsa SHA256:[host key here] debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in C:\\Users\\User/.ssh/known_hosts:2 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: C:\\Users\\User/.ssh/id_rsa RSA SHA256:[key here] debug1: Will attempt key: C:\\Users\\User/.ssh/id_dsa debug1: Will attempt key: C:\\Users\\User/.ssh/id_ecdsa debug1: Will attempt key: C:\\Users\\User/.ssh/id_ed25519 debug1: Will attempt key: C:\\Users\\User/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<email@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org,email@example.com,firstname.lastname@example.org,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: C:\\Users\\User/.ssh/id_rsa RSA SHA256:[key here] debug1: Server accepts key: C:\\Users\\User/.ssh/id_rsa RSA SHA256:[key here] debug1: read_passphrase: can't open /dev/tty: No such file or directory Enter passphrase for key 'C:\Users\User/.ssh/id_rsa': [i enter the passphrase] debug1: Authentication succeeded (publickey). Authenticated to github.com ([ip address]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: pledge: network debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 Hi EdenSweden! You've successfully authenticated, but GitHub does not provide shell access. debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 3400, received 2868 bytes, in 0.6 seconds 1
So clearly my SSH key is working. I even created a whole new SSH key and that one still isn’t allowing me to complete npm run deploy. What do I do from here? I have followed the troubleshooting steps in the Github documentation, but to no avail.
Could it be because it never asks for my passphrase when running
gh-pages -d build?
The SSH folder on my computer has no config file, if that means anything. Just id_rsa, id_rsa.pub, and known_hosts.
Thank you sooo much for your help. I have been stuck for days. Most online explanations seem to assume I already know Git/Node and don’t explain things clearly at all.