chore: prepare update scripts for Corepack global install #1425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
General improvements also:
echo
commands for consistency.Requirements
The scripts require the following components to be installed:
For Node.js
20.x LTS
,22.x LTS
and24.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.js22.14.0
LTSTest these scenarios:
npm install corepack@latest -g
corepack disable npm
(should warn to install Node.js)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