Skip to content

Add quoting advice for PowerShell CLI options #6169

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 6 commits into from
May 7, 2025

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented May 4, 2025

Situation

CLI options that include multiple values separated with commas, such as for --config, --env or --reporter-options may be misinterpreted when executing Cypress CLI in PowerShell on Windows.

The following documentation example cypress run --config generally fails to run in PowerShell 7.5.1 on Windows 11 24H2, Cypress 14.3.2 with package managers: npm, pnpm and Yarn:

cypress run --config pageLoadTimeout=100000,watchForFileChanges=false

The error is:

An invalid configuration value was set.

Expected pageLoadTimeout to be a number.

Instead the value was: "100000 watchForFileChanges=false"

An exception is npm@10.8.2 under Node.js v20.19.1 using npx cypress run where it works correctly.

Using PowerShell 7.5.1 on Ubuntu 24.04.2 LTS shows no issues with executing the above command in each of the package managers (npm, pnpm and Yarn).

Change

Add an info admonition to https://docs.cypress.io/app/references/command-line to advise enclosing the options in quotes:

When cypress run options or cypress open options are specified with multiple values separated by commas, such as for --config or --env options, and you are using PowerShell on Windows, you may need to surround the key/value pairs with quotes, for example: --env "host=api.dev.local,port=4222".

Copy link

netlify bot commented May 4, 2025

👷 Deploy request for cypress-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d8d5eb0

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

image

@jennifer-shehane jennifer-shehane merged commit 61cc806 into cypress-io:main May 7, 2025
5 checks passed
@MikeMcC399 MikeMcC399 deleted the powershell-quoting branch May 7, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress PowerShell: broken comma-separated-values CLI parsing since NodeJS 22.0.0
3 participants