2

I'm trying to install something from a private repo, I'm running:

npm i git+ssh://git.remoterepo.net/somerepo.git

I have a SSH key at ~/.ssh/id_rsa which has no passphrase and it's configured at my remote git repo (gitlab).

However each time it prompts me:

[MAC_USER]@git.remoterepo.net's password:

It should be using [email protected] (git username). If I SSH with the git username then I can log in:

ssh [email protected]

But if I do ssh [MAC_USER]@git.remoterepo.net then it prompts me for a password and can't. I've tried npm i git@git+ssh://git.remoterepo.net/somerepo.git but it still uses the wrong username..

How can I make npm install use the git username instead of my mac login one?

I've also tried HTTPS but no luck (hangs or gives 401 Unauthorized).

Thanks!

1 Answer 1

3

Try using npm i git+ssh://[email protected]/somerepo.git.

Search for git@ in https://docs.npmjs.com/cli/install

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.