What I have
- Private GitHub repository: a NodeJS private module/package.
- SSH private-public keys created with
ssh-keygen
:- Private key stored at
C:\Users\USER\.ssh\id_rsa
. - Public key added to GitHub.
- Private key stored at
What I want
To install the private module (hosted on GitHub) using:
npm install
- SSH public-private authentication (in particular, using the
id_rsa
SSH private key saved inC:\Users\USER\.ssh
).
What happen
When I execute:
npm install git@github.com:USER/REPO.git --save
the following popup is shown:
I want to avoid this popup. Instead, the id_rsa
SSH private key password must be request.
If I execute a command using git
utility like this:
git clone git@github.com:USER/REPO.git
the SSH private key is used:
Cloning into 'REPO'...
Enter passphrase for key '/c/Users/USER/.ssh/id_rsa':
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 20 (delta 4), reused 20 (delta 4), pack-reused 0
Receiving objects: 100% (20/20), done.
Resolving deltas: 100% (4/4), done.
Environment
- Windows 10 Pro 21H1 19043.1526
- NodeJS 16.13.1
- NPM 7.19.1