docs: add note for node_modules for Yarn and pnpm (#48495)

* Add instructions on using node_modules with Yarn

* update text for pnpm

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
This commit is contained in:
trop[bot] 2025-10-09 10:31:24 +02:00 committed by GitHub
commit 238022c5cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,6 +55,18 @@ There are a few rules to follow for the purposes of this tutorial:
- _author_, _license_, and _description_ can be any value, but will be necessary for
[packaging][packaging] later on.
:::caution Install dependencies with a regular `node_modules` folder
Electron's packaging toolchain requires the `node_modules` folder to be physically on disk in the
way that npm installs Node dependencies. By default, [Yarn Berry](https://yarnpkg.com/) and
[pnpm](http://pnpm.io/) both use alternative installation strategies.
Therefore, you must set [`nodeLinker: node-modules`](https://yarnpkg.com/configuration/yarnrc#nodeLinker)
in Yarn or [`nodeLinker: hoisted`](https://pnpm.io/settings#nodelinker) in pnpm if you are using
those package managers.
:::
Then, install Electron into your app's **devDependencies**, which is the list of external
development-only package dependencies not required in production.