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

* Add instructions on using node_modules with Yarn

* update text for pnpm

---------

Co-authored-by: CodingOtto <otto+github@fysiker.fi>
This commit is contained in:
Erick Zhao
2025-10-09 00:48:22 -07:00
committed by GitHub
parent ffbae02a95
commit df86312e2f

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.