> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/yarn-private-packages.md).

# Yarn - プライベートパッケージ

Aikido がプライベートパッケージを使用するリポジトリの依存関係を更新する際、lockfile を正しく更新するためにそれらのパッケージへのアクセスが必要です。Aikido を設定して、プライベート NPM レジストリで認証し、これらの更新を実行できます。

## 前提条件 <a href="#prerequisites" id="prerequisites"></a>

〜を使用している場合 **Yarn v1**、 `.npmrc` Aikido でのオプションは、次のように説明されている [NPM および PNPM のドキュメント](/docs/docs-ja/autofix-to/connect-private-packages/npm-private-packages.md)。なお、 **Yarn v2 以降**、 `.yarnrc.yml` プライベートパッケージへのアクセスを構成するためのファイル。

### **設定 `.yarnrc.yml`**

プライベートパッケージへのアクセスは、ある `.yarnrc.yml` プロジェクト内のファイル。このファイルでは、 `npmScopes` プライベートパッケージに対して使用するレジストリを指定します。

もし `.yarnrc.yml` ファイルが Aikido で設定されている場合、私たちはその `.yarnrc.yml` あなたの隣のファイル `yarn.lock` 依存関係を更新する前にファイルを作成します。もし `.yarnrc.yml` そのファイルがリポジトリに存在する場合、 `.yarnrc.yml` Aikido で設定されたファイルによって上書きされます。

例 `.yarnrc.yml`

```yaml
npmScopes:
  piedPiper:
    npmAuthToken: "<YOUR_GITHUB_TOKEN>"
    npmRegistryServer: "https://npm.pkg.github.com"
```

詳細は Yarn のドキュメントで確認できます [こちら](https://yarnpkg.com/configuration/yarnrc#npmScopes).

## Aikido での設定 <a href="#configuration-in-aikido" id="configuration-in-aikido"></a>

プライベートパッケージを使用するリポジトリを更新できるようにするには、Aikido UI にプライベートレジストリ設定を提供してください。Aikido は認証情報を暗号化して保存し、認証情報は Aikido UI や API から取得できません。

1. 移動先 *自動修正* > *設定* Aikido で、 [こちら](https://app.aikido.dev/issues/fix/settings).
2. 「*レジストリを接続*」と、選択モーダルが表示されます。

<figure><img src="/files/93d539d9c2979772d40a2c418b778a2cd588532f" alt=""><figcaption></figcaption></figure>

3. Yarn を選択して、あなたの `.yarnrc.yml` ファイル。（Yarn V1 では NPM を選択する必要があることに注意してください。）

<figure><img src="/files/f0c2399b32188b9026d9109bb246fd22592dd755" alt=""><figcaption></figcaption></figure>

4. ファイルの内容を入力してください。 `.yarnrc.yml` ファイル。例では、piedPiper GitHub 組織における GitHub Packages の設定を示しています。
5. クリック「*レジストリを接続*」をクリックして設定を保存します。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/yarn-private-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
