Skip to content

Commit c2077a9

Browse files
erickzhaogitbook-bot
authored andcommitted
GITBOOK-209: pnpm support documentation
1 parent 261df86 commit c2077a9

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,30 @@ description: Quickly scaffold an Electron project with a full build pipeline
44

55
# Getting Started
66

7-
## Overview
8-
97
Electron Forge is an all-in-one tool for packaging and distributing Electron applications. It combines many single-purpose packages to create a full build pipeline that works out of the box, complete with code signing, installers, and artifact publishing. For advanced workflows, custom build logic can be added in the Forge lifecycle through its [Plugin API](config/plugins/). Custom build and storage targets can be handled by creating your own [Makers](config/makers/) and [Publishers](config/publishers/).
108

11-
## Creating a new app
9+
## Prerequisites
1210

13-
To get started with Electron Forge, we first need to initialize a new project with `create-electron-app`. This script is a convenient wrapper around Forge's [Init](cli.md#Init) command.
11+
* [Node.js](https://nodejs.org/) ≥ v16.4.0
12+
* [Git](https://git-scm.com/)
13+
* A JavaScript package manager:
14+
* [npm](https://www.npmjs.com/)
15+
* [Yarn Classic](https://classic.yarnpkg.com/)
16+
* [pnpm](https://pnpm.io/) (as of Forge v7.7.0)
1417

1518
{% hint style="warning" %}
16-
Electron Forge currently only supports npm and Yarn Classic. If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
19+
#### **Packaging requires `node_modules` to be on disk**
20+
21+
When packaging your Electron app, Forge crawls your project's `node_modules` folder to collect dependencies to bundle. Its module resolution algorithm is naive and doesn't take into account symlinked dependencies nor Yarn's Plug'n'Play (PnP) format.
22+
23+
* If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
24+
* If you are using pnpm, please set `node-linker=hoisted` in your project's `.npmrc` configuration.
1725
{% endhint %}
1826

27+
## Creating a new app
28+
29+
To get started with Electron Forge, we first need to initialize a new project with `create-electron-app`. This script is a convenient wrapper around Forge's [Init](cli.md#Init) command.
30+
1931
```bash
2032
npx create-electron-app@latest my-app
2133
```

cli.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ npm run package -- --arch="ia32"
104104
npx electron-forge package --arch="ia32"
105105
```
106106

107+
{% hint style="warning" %}
108+
#### **Packaging requires `node_modules` to be on disk**
109+
110+
When packaging your Electron app, Forge crawls your project's `node_modules` folder to collect dependencies to bundle. Its module resolution algorithm is naive and doesn't take into account symlinked dependencies nor Yarn's Plug'n'Play (PnP) format.
111+
112+
* If you are using Yarn >=2, please use the `nodeLinker: node-modules` install mode.
113+
* If you are using pnpm, please set `node-linker=hoisted` in your project's `.npmrc` configuration.
114+
{% endhint %}
115+
107116
### Make
108117

109118
This command will make distributables for your application based on your Forge config and the parameters you pass in.

0 commit comments

Comments
 (0)