[FIXED] npm / git fails with: refusing to work with credential missing host field

Issue

I need to install a dependency from git like this:

npm i git://hostname.com/scm/projects/project.name.git#tag123

unfortunatly it fails with:

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\mingw64\bin\git.EXE ls-remote -h -t git://hostname.com/scm/projects/project.name.git
npm ERR!
npm ERR! fatal: refusing to work with credential missing host field
npm ERR!
npm ERR! exited with error code: 128

my .git-credentials looks like this:

https://username:password@hostname.com/

and .gitconfig looks like this:

[https]
[http "https://hostname.com"]
    sslCert = D:/git/ssl.crt
    sslKey = D:/git/ssl.key
    sslVerify = false
[url "https://hostname.com/"]
    insteadOf = git://hostname.com/

[core]
    longpaths = true
[credential]
    helper = store

What is wrong here and how to solve it?

Solution

Solution

Delete the git installation folder (e.g.: C:\Program Files\Git) completely and install the latest git version from https://git-scm.com/downloads.

Seems like a git interanl config get corrupt.

Answered By – Chriss

Answer Checked By – Laura B. (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published