Skip to content

chore: prepare update scripts for Corepack global install #1425

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

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Apr 9, 2025

This PR affects repo maintainers only.

Situation

Cypress GitHub Action uses the experimental Corepack only for Yarn Modern, where it is the recommended framework for installation (see Yarn Installation). The Yarn documentation instructs to install Corepack with npm install -g corepack.

Installing Corepack globally, instead of using the Corepack version bundled with Node.js, automatically enables Corepack for both Yarn and pnpm.

This means that corepack disable pnpm must be executed, however that also disables any globally installed version of pnpm.

This affects the working of the update:cypress maintenance scripts which are used to update Cypress when new versions are released.

Change

The set of update scripts is re-worked.

In scripts/update-cypress-latest-pnpm.sh

  1. Disable Corepack for pnpm if installed
  2. Install the latest version of pnpm

General improvements also:

  • Added echo commands to show which package manager versions are being used / installed.
  • Removed quoting in bash echo commands for consistency.

Requirements

The scripts require the following components to be installed:

  • Node.js LTS
  • Corepack (because it is needed for Yarn Modern installation)

For Node.js 20.x LTS, 22.x LTS and 24.x (planned April 2025) Corepack is bundled.
Starting with Node.js 25.x (planned October 2025), Corepack is no longer bundled with Node.js and needs to be installed separately.

Verification

On Ubuntu 22.04.2 LTS, Node.js 22.14.0 LTS

Test these scenarios:

  1. Node.js LTS installed - no additional global installation of Corepack
  2. Global installation of Corepack with npm install corepack@latest -g
  3. Corepack installed, corepack disable npm (should warn to install Node.js)
  4. Corepack uninstalled npm uninstall corepack -g

with:

git clean -xfd
git restore .
./scripts/update-cypress-latest-pnpm.sh

and with:

git clean -xfd
git restore .
npm run update:cypress

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this Apr 9, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 9, 2025 12:52
@jennifer-shehane jennifer-shehane merged commit 0d56649 into cypress-io:master Apr 10, 2025
76 checks passed
@MikeMcC399 MikeMcC399 deleted the corepack-global-install branch April 10, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants