# Discourse Theme CLIのエラーがpnpmインストールのnode\_modulesとシンボリックリンクのために発生

**URL:** <https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168>\
**Category:** Development\
**Created:** [2024 年 12 月 8 日午前 4:14 UTC](https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168 "2024-12-08T04:14:15Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)\
**Post date:** [2024 年 12 月 8 日午前 4:14 UTC](https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168/1 "2024-12-08T04:14:15Z")

</div>

pnpm を使用して `node_modules` をインストールしたテーマコンポーネントリポジトリで Discourse Theme CLI を実行すると、`discourse_theme watch .` コマンドは `node_modules/.pnpm` ディレクトリが既に監視されているというエラーを返します。一見したところ、これはパッケージがシンボリックリンクされていることが原因のようです。

公式のマーメイド TC を使用し、最新の GitHub Codespace でこれをテストしました。`discourse_theme` v2.1.3 を使用しています。

> **エラーログの抜粋**
>
> ```plaintext
> **ERROR: directory is already being watched!**
> 
> Directory: /workspaces/discourse-mermaid-theme-component/node_modules/.pnpm/ember-template-recast@6.1.5/node_modules/@glimmer/reference
> 
> is already being watched through: /workspaces/discourse-mermaid-theme-component/node_modules/.pnpm/@glimmer+reference@0.84.3/node_modules/@glimmer/reference
> 
> MORE INFO: https://github.com/guard/listen/blob/master/README.md
> **ERROR: directory is already being watched!**
> 
> Directory: /workspaces/discourse-mermaid-theme-component/node_modules/.pnpm/@humanwhocodes+retry@0.3.1/node_modules/@humanwhocodes/retry
> 
> is already being watched through: /workspaces/discourse-mermaid-theme-component/node_modules/.pnpm/@humanwhocodes+retry@0.3.1/node_modules/@humanwhocodes/retry
> 
> MORE INFO: https://github.com/guard/listen/blob/master/README.md
> 
> ```

`discourse_theme` が `node_modules/.pnpm` または `node_modules` 全般の無視設定なしにディレクトリ全体を監視していることが原因だと推測されます。

これは `discourse_theme watch` がエラーの後も問題なく動作するため、重大な問題ではありません。しかし、エラーの後に表示されるはずの `\"Watching for changes...\"` メッセージが表示されないため、混乱を招く可能性があります。また、npm/yarn から pnpm に移行したにもかかわらず、CLI が画面に多数のエラーを表示するのは、あまり良い体験ではありません。

---

_[View the full topic](https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168)._
