Skip to content

Commit 7626c57

Browse files
authored
extend pnpm config instructions (#6149)
1 parent 7d2429b commit 7626c57

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/app/get-started/install-cypress.mdx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,23 @@ is preferred. Cypress [Component Testing](/app/core-concepts/testing-types#What-
157157

158158
#### pnpm Configuration
159159

160+
The following configuration options enable Cypress to execute its `postinstall` script so it can install the Cypress binary into the [binary cache](/app/references/advanced-installation#Binary-cache).
161+
If these configuration options are not set, then Cypress may skip the `postinstall` script execution and Cypress will not run.
162+
163+
The pnpm [side effects cache](https://pnpm.io/settings#sideeffectscache) uses and caches the results of (pre/post)install hooks and is not compatible with Cypress' own caching.
164+
Disable the pnpm [side effects cache](https://pnpm.io/settings#sideeffectscache), for example using the following command, executed in the root of your Cypress project:
165+
166+
```shell
167+
pnpm config set side-effects-cache false --location project
168+
```
169+
160170
[[email protected]](https://github.com/pnpm/pnpm/releases/tag/v10.0.0) and above require allowlisting `cypress`.
161-
This enables Cypress to execute its `postinstall` script so it can install the Cypress binary into the [binary cache](/app/references/advanced-installation#Binary-cache).
162-
Refer to the [pnpm](https://pnpm.io/) configuration file documentation for additional information.
163-
[[email protected]](https://github.com/pnpm/pnpm/releases/tag/v10.4.0) introduced the CLI add option [--allow-build](https://pnpm.io/cli/add#--allow-build) to add the allowed build configuration directly through the command line.
171+
Refer to the [pnpm settings](https://pnpm.io/settings) documentation for additional information.
172+
In [[email protected]](https://github.com/pnpm/pnpm/releases/tag/v10.4.0) and above, the CLI `add` option [--allow-build](https://pnpm.io/cli/add#--allow-build) can be used, for example:
173+
174+
```shell
175+
pnpm --allow-build cypress add --save-dev cypress
176+
```
164177

165178
### Hardware
166179

0 commit comments

Comments
 (0)