How to fix error on npm install from git private repo


gitのprivate repoからnpm installしようとして以下のエラーが出たときの解決法メモ

...
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
...
  1. ~/.ssh に行って ssh-keygen
  2. github で公開鍵を登録
  3. ~/.ssh/configに以下を記載
Host github
  HostName github.com
  IdentityFile ~/.ssh/id_rsa
  User git

.4. ssh -T [email protected]

Hi <YOUR_NAME>! You've successfully authenticated, but GitHub does not provide shell access.

と表示されたらOK(多分)