Skip to content

Cypress uses the system Node.js when nodeVersion is set to bundled #27016

@JessefSpecialisterren

Description

@JessefSpecialisterren

Current behavior

When the nodeVersion configuration option is set to bundled, Cypress uses the system Node.js to execute setupNodeEvents and tasks

Desired behavior

I see two ways of fixing this bug:

  1. Fix the nodeVersion configuration option so that bundled works as it used to, and Cypress uses the bundled Node.js to execute setupNodeEvents and tasks
  2. Remove the nodeVersion configuration option altogether, as has been the stated intention since Cypress 9.0.0

My team and I would prefer solution 1, as stated and explained in #18882 . However, that issue didn't gain a lot of traction, so if you choose solution 2 I can understand that

Test code to reproduce

cypress.config.js:

module.exports = {
  e2e: {
    nodeVersion: 'bundled',
    setupNodeEvents(on, config) {
      console.log(process.version)
      on('task', {
        logNodeVersion() {
          console.log(process.version)
          return true
        }
      })
    },
  },
}

spec.cy.js:

it('', () => {
  cy.task('logNodeVersion')
})

Make sure you have a system Node.js with a different version than the bundled Node.js. Note the version logged in the terminal when you select E2E testing and when you run spec.cy.js

Cypress Version

12.14.0

Node version

v18.16.0

Operating System

Windows 10.0.19044.2965

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingReproducibleCan be reproducedTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.type: bugv10.0.0 🐛Issue present since 10.0.0

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions