# npm ERR! code 128 — An unknown git error occurred (git dependency install)

**Code:** `npm git dependency error` · **Category:** npm · **Seen on:** npm

npm failed to fetch a dependency that points to a Git repository.

## 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

1. Install git in the image
2. Provide credentials (deploy key or token)
3. Switch to git+https with a token, or publish the package to a registry

## Detailed fix by platform

### npm

1. `"dependency": "git+https://${GITHUB_TOKEN}@github.com/acme/lib.git#v1.2.0"`

## How to diagnose

1. **Git** — Installed?
2. **Access** — Can you clone the URL manually?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/npm-unknown-git-error)
