I was following along Lukas White and James Hibbard tutorial on "creating a command line application using Node.js " and the overall experience was fun and learned a lot of new things. I would like to thank Lukas and James for easy to follow tutorial and the guide.
I followed along all the way until the final application was running. Now the problem is when I create a new Repo via command-line, it asks me whether it’s a public or private and if I choose any option the program crashes with the message below:
"Error: git@github.com: Permission denied (publickey)."
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It creates the new repo on the github account but crashes the program. From the error I get, it is pretty much evident that the crash is due to an Unhandled Promise and probably due to some error in token or something but since I’m not an advanced Node developer, I cannot figure out what actually is going on.
If anybody could help me through this, it would be such a great help.
Also if authors are here in this forum, I would be glad to know your say on it.
The ssh_url property on the response will be in the following form: git@github.com:<your-username>/<repo-name>.git.
You can check this by typing git remote -v in your project root directory.
As the variable name suggests, this is a SSH URL. These provide access to a Git repository via SSH, a secure protocol. To use these URLs, you must generate an SSH keypair on your computer and add the public key to your GitHub account.
I’m guessing you don’t have this set up, which is why the final step is failing.
The easiest thing to do at this point would be to set up SSH on your account. Here’s how:
This also has the advantage that you don’t have to enter your credentials when pushing to GitHub.