Skip to content

Cypress PowerShell: broken comma-separated-values CLI parsing since NodeJS 22.0.0 #6166

@alexsch01

Description

@alexsch01

PowerShell Command

npx cypress run --env a=1,b=2,c=3

Current behavior

{ a: '1 b=2 c=3' }

NodeJS 22.0.0 is different from older versions that it includes C:\Program Files\nodejs\npx.ps1 file

Desired behavior

{ a: 1, b: 2, c: 3 }

Test code to reproduce

cypress/e2e/spec.cy.js

it('', () => {
    cy.task('log', Cypress.env())
})

cypress.config.js

const { defineConfig } = require('cypress');

module.exports = defineConfig({
    e2e: {
        supportFile: false,
        screenshotOnRunFailure: false,
        setupNodeEvents(on) {
            on('task', {
                log(str) {
                    console.log(str)
                    return null;
                },
            });
        },
    },
});

Cypress Version

any (14.3.2 tested)

Node version

v22.0.0+ (v22.15.0 tested)

Operating System

Windows 10 22H2

Extra Information

  1. This issue affects --env and --config parsing
  2. Deleting C:\Program Files\nodejs\npx.ps1 is a workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions