Report this

What is the reason for this report?

Can't npm install GitHub Repository - Get error git@github.com: Permission denied (publickey).

Posted on June 19, 2021

Hi Everyone!

I have been trying to figure out how to successfully install an npm package hosted on my Github account. It works locally on my mac but not from my Digital Ocean Droplet.

Here are the guides I have looked at it and tried: https://www.digitalocean.com/community/questions/permission-denied-publickey-using-git-from-digitalocean-console-forge-user

https://stackoverflow.com/questions/57808112/digitalocean-and-github-permission-denied

and several others!

Nothing works.

I regenerated new keys and uploaded them to GitHub but still nothing.

The command I am trying to run is:

npm install git+ssh://github.com/mujibsardar/nodebb-theme-askavan.git

I get:

35 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "git+ssh://github.com/mujibsardar/nodebb-theme-askavan.git"
36 verbose node v10.16.0
37 verbose npm  v7.18.1
38 error code 128
39 error command failed
40 error command git --no-replace-objects ls-remote ssh://git@github.com/mujibsardar/nodebb-theme-askavan.git
41 error git@github.com: Permission denied (publickey).
41 error fatal: Could not read from remote repository.
41 error
41 error Please make sure you have the correct access rights
41 error and the repository exists.
42 verbose exit 128

here are the permissions on my .ssh directory

drwx------ 2 root root 4096 Feb  1 21:21 .
drwx------ 9 root root 4096 Jun 18 22:34 ..
-rw-r--r-- 1 root root  103 Jun 19 16:33 authorized_keys
-rw------- 1 root root  411 Jun 18 18:59 id_ed25519
-rw-r--r-- 1 root root  103 Jun 18 18:59 id_ed25519.pub
-rw-r--r-- 1 root root 1548 Jun 18 18:26 known_hosts

My apologies if I missed to share something more fundamental. Any help would be highly appreciated!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.