Skip to content

extend pnpm config instructions #6149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions docs/app/get-started/install-cypress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,23 @@ is preferred. Cypress [Component Testing](/app/core-concepts/testing-types#What-

#### pnpm Configuration

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).
If these configuration options are not set, then Cypress may skip the `postinstall` script execution and Cypress will not run.

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.
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:

```shell
pnpm config set side-effects-cache false --location project
```

[[email protected]](https://github.com/pnpm/pnpm/releases/tag/v10.0.0) and above require allowlisting `cypress`.
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).
Refer to the [pnpm](https://pnpm.io/) configuration file documentation for additional information.
[[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.
Refer to the [pnpm settings](https://pnpm.io/settings) documentation for additional information.
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:

```shell
pnpm --allow-build cypress add --save-dev cypress
```

### Hardware

Expand Down