I have problems installing some NPM packages. This happens when NPM package (angular2-materialize
for example) is installed from the repo:
npm i InfomediaLtd/angular2-materialize
Also happens with its forks, too. I've tried to to create own forks with same results.
Installing it results in error,
Error: Command failed: git -c core.longpaths=true clone --template=<...>\npm-cache\_git-remotes\_templates --mirror [email protected]:InfomediaLtd/angular2-materialize.git <...>\npm-cache\_git-remotes\git-github-com-InfomediaLtd-angular2-materialize-git-2ec1a411
Cloning into bare repository '<...>\npm-cache\_git-remotes\git-github-com-InfomediaLtd-angular2-materialize-git-2ec1a411'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The repo is public, it surely exists and can be cloned with
git clone git://github.com/InfomediaLtd/angular2-materialize.git
On the other hand, there's no error on this fork (repo name has been changed):
npm i thcheng/angular-plus-materialize
And other repos can be installed without problems as well:
npm i toddmotto/angular-component
I've tried this with all NPM versions on Windows, also tried this on Ubuntu server with same results. I run NPM as admin/root and tried to clean NPM cache (as relevant questions usually suggest).
Is there something wrong with this repo in particular? What is going on there and how can this be fixed?
You may encounter this error when installing npm. This happens when you list a git repository as a dependency in your package. json file. If the repository is private, add an additional SSH key in Project settings > SSH Keys > Additional SSH Keys.
The npm installation from GitHub is quite useful for testing packages. It also gives the flexibility to install any specific branch, version, tag, and so on.
Add the GitHub repository URL there: "repository": { "type": "git", "url": "https://github.com/your-user/repo-url.git" }, Make sure you specify git as type and that the URL is pointing to the actual repository, not an HTML page. So the URL has to end with .
You don't have ssh key on your machine.
if you wish to clone it without ssh key use the https
method instead of the git ://
Generate a new ssh key (or skip this step if you already have a key)ssh-keygen
Get the keycat ~/.ssh/id_rsa.pub
Login to github account
Click on the rancher on the top right (Settings)
Click on the SSH keys
Click on the Add ssh key
Paste your key and save
And you all set to go :-)
Configure the ssh-agent program to use your SSH key:
Make sure your id_rsa
file is in the folder c:\users\$username\.ssh
Open console and run start-ssh-agent
. It will find your id_rsa
and prompt you for the passphrase:
start-ssh-agent
Removing old ssh-agent sockets
Starting ssh-agent: done
Enter passphrase for /c/Users/youruser/.ssh/id_rsa:
Identity added: /c/Users/youruser/.ssh/id_rsa (/c/Users/youruser/.ssh/id_rsa)
Then try to run npm install
again.
Note: It's also might be possible that ssh-agent is already running:
start-ssh-agent
Found ssh-agent at 402860
Found ssh-agent socket at /tmp/ssh-YT2trepckpeN/agent.431360
In this case use ssh-add
It will find your id_rsa
and prompt you for the passphrase:
ssh-add
Enter passphrase for /c/Users/youruser/.ssh/id_rsa:
Identity added: /c/Users/youruser/.ssh/id_rsa (/c/Users/youruser/.ssh/id_rsa)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With