npm ERR! code 128 — An unknown git error occurred (git dependency install)
npm failed to fetch a dependency that points to a Git repository.
Exact message you may see
An unknown git error occurrednpm ERR! code 128
Seen on:
npm
Meaning
Git-URL dependencies need git installed and access to the repo (SSH keys or tokens). CI images often lack either.
Common causes
- git not installed in the environment
- No access to the private repo (SSH key/token)
- git+ssh URL in an environment with only HTTPS access
⚡ Quick fix
- Install git in the image
- Provide credentials (deploy key or token)
- Switch to git+https with a token, or publish the package to a registry
Detailed fix by platform
npm
"dependency": "git+https://${GITHUB_TOKEN}@github.com/acme/lib.git#v1.2.0"
How to diagnose
- Git — Installed?
- Access — Can you clone the URL manually?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 0x8007007E 0x8007007E: The specified module could not be found
- Dependency requires compileSdk Dependency 'androidx.x:1.y' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs
- E404 npm ERR! code E404 — 404 Not Found: package@version is not in this registry
Most viewed in npm
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 13 Oct 2026