> 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/autofixto/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/autofixto/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="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-9266e8da54be5ee4e49440d10a643bfa587a37ac%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-3e3f35a01be38f1f9093b9efca63159b5ade7ead%2Fimage.png?alt=media" 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/autofixto/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.
