npm ERR! code 128 — An unknown git error occurred (git dependency install)
npm failed to fetch a dependency that points to a Git repository.
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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026