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:
- 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
- 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
Current behavior
When the
nodeVersionconfiguration option is set tobundled, Cypress uses the system Node.js to executesetupNodeEventsand tasksDesired behavior
I see two ways of fixing this bug:
nodeVersionconfiguration option so thatbundledworks as it used to, and Cypress uses the bundled Node.js to executesetupNodeEventsand tasksnodeVersionconfiguration option altogether, as has been the stated intention since Cypress 9.0.0My 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:
spec.cy.js:
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