# 错误：chart 需要依赖项。Chart.yaml 有依赖项，但没有 'charts/' 目录。运行 'helm dependency update' 以生成 charts 目录。

- **ID:** `cicd/helm-chart-dependency-missing`
- **领域:** cicd
- **类别:** build_error
- **错误码:** `HELM_DEP_MISSING`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

Helm chart 在 Chart.yaml 中声明了依赖项，但 charts/ 目录缺失，因为依赖项未下载或未提交到仓库。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Helm 3.12.0 | active | — | — |
| Helm 3.14.1 | active | — | — |

## 解决方案

1. ```
   Run 'helm dependency update ./chart-dir' in the chart directory to download dependencies into the charts/ folder. Then commit the charts/ directory to your repository.
   ```
2. ```
   Add a CI step before deployment: 'helm dependency build ./chart-dir' to ensure dependencies are fetched fresh each build without committing charts/.
   ```

## 无效尝试

- **** — Manually creating an empty charts/ directory does not resolve the error because the actual dependency packages are missing. (90% 失败率)
- **** — Deleting Chart.yaml dependencies and re-adding them without running helm dependency update still leaves charts/ empty. (70% 失败率)
- **** — Using helm install --dependency-update flag may fail if the chart repository is not accessible (e.g., private repo). (50% 失败率)
