# Discourse Theme CLI errors with pnpm installed node\_modules due to symlinks

**URL:** <https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168>\
**Category:** Development\
**Created:** [December 8, 2024, 4:14am 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:** 5

<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:** [December 9, 2024, 11:04pm UTC](https://meta.discourse.org/t/discourse-theme-cli-errors-with-pnpm-installed-node-modules-due-to-symlinks/341168/5 "2024-12-09T23:04:19Z")

</div>

> [@merefield](#):
>
> that’s fine, but nothing stopping you running it from another terminal tab … and from the discourse directory?

Certainly its arbitrary, but its a bit ridiculous to need to run the discourse\_theme from a local clone of discourse when the discourse instance being tested is not the local instance.

Anyway, I have done as you suggested, both in a fresh github codespace, and in my own dev environment, and it still throws the same errors.

* * *

Reading through all of the log (or all the ones that will fit in the terminal history), all the directories it is erroring on is `/node_modules/.pnpm`. Testing and running `discourse_theme` against a different TC that has yet to be updated to use pnpm instead of yarn, I don’t see any errors, so I’m almost 100% certain the issue is with it watching `.pnpm`.

From [Symlinked `node_modules` structure | pnpm](https://pnpm.io/symlinked-node-modules-structure), it looks like the normal structure of node\_modules is preserved by moving all the actual code into `/node_modules/.pnpm` and the rest of directories in `/node_modules/` are just symlinks to `.pnpm`. So ignoring `.pnpm` avoids the “directory is already being watched!” error.

I’ve played a bit with the discourse\_theme gem and added `listener.ignore /node_modules\/\.pnpm/` to the `watcher.rb`, and it seems to work fine without any error messages. It even detected a new pnpm package install.

---

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