Skip to content

test: set npm allow-scripts for cypress#1783

Merged
mschile merged 4 commits into
cypress-io:masterfrom
MikeMcC399:npm-allow-scripts-cypress
Jun 9, 2026
Merged

test: set npm allow-scripts for cypress#1783
mschile merged 4 commits into
cypress-io:masterfrom
MikeMcC399:npm-allow-scripts-cypress

Conversation

@MikeMcC399

@MikeMcC399 MikeMcC399 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Situation

When the .github/workflows/example-node-versions.yml is run, it now outputs a warning for Node.js 26

npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn allow-scripts   cypress@15.16.0 (postinstall: node dist/index.js --exec install)
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.

Node.js 26.3.0 is installed with bundled npm 11.16.0

Change

Running under Node.js 26.3.0 (with npm 11.16.0), and for all npm-based Cypress examples, apply:

npm approve-scripts cypress --no-allow-scripts-pin

Use a copy of scripts/update-cypress-latest-npm.sh to assist looping through all sub-directories.

For examples/nextjs additionally allow sharp as a dependency of next since it requires node-gyp to rebuild.


Note

Low Risk
Example-only package.json metadata changes; no runtime or CI workflow logic is modified beyond silencing npm install-script warnings.

Overview
Adds npm allowScripts configuration to every npm-based Cypress example package.json so installs under Node.js 26 / npm 11 no longer emit allow-scripts warnings about Cypress’s postinstall.

Each example now sets "cypress": true under allowScripts. examples/nextjs also allows sharp (Next.js dependency with native install scripts).

Reviewed by Cursor Bugbot for commit 70d7d0e. Bugbot is set up for automated code reviews on this repo. Configure here.

and for sharp in examples/nextjs
@cypress-app-bot

Copy link
Copy Markdown
Collaborator

@MikeMcC399 MikeMcC399 self-assigned this Jun 4, 2026
@MikeMcC399 MikeMcC399 added type: enhancement New feature or request tests labels Jun 4, 2026
@MikeMcC399 MikeMcC399 marked this pull request as ready for review June 4, 2026 10:46
@MikeMcC399 MikeMcC399 requested a review from mschile June 4, 2026 10:46
@mschile mschile merged commit 4aca2e9 into cypress-io:master Jun 9, 2026
87 checks passed
@MikeMcC399 MikeMcC399 deleted the npm-allow-scripts-cypress branch June 9, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow-scripts warning on Node.js 26.3.0

3 participants