Skip to content

Commit a826a9c

Browse files
committed
fix: add new node 20 version
1 parent 40dfaf3 commit a826a9c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

cli/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ _Released 3/25/2025 (PENDING)_
88
- Upgraded `systeminformation`
99
from `5.21.7` to `5.22.8`. Addressed in [#31281](https://github.com/cypress-io/cypress/pull/31281).
1010

11+
**Bugfixes:**
12+
13+
- Applies a fix from [#30730](https://github.com/cypress-io/cypress/pull/30730) related to Node.js turning on loading native ES modules using require() by default in Node.js version `20.19.0`.
14+
1115
## 14.2.0
1216

1317
_Released 3/12/2025_

packages/data-context/src/data/ProjectConfigIpc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ export class ProjectConfigIpc extends EventEmitter {
325325
tsNodeEsmLoader = `${tsNodeEsmLoader} --no-experimental-detect-module`
326326
}
327327

328-
// in nodejs 22.12.0, the --experimental-require-module option is now enabled by default.
328+
// in nodejs 20.19.0, 22.12.0, the --experimental-require-module option is now enabled by default.
329329
// We need to disable it with the --no-experimental-require-module flag.
330330
// @see https://github.com/cypress-io/cypress/issues/30715
331-
if (this.nodeVersion && semver.gte(this.nodeVersion, '22.12.0')) {
331+
if (this.nodeVersion && (semver.gte(this.nodeVersion, '22.12.0') || semver.gte(this.nodeVersion, '20.19.0'))) {
332332
debug(`detected node version ${this.nodeVersion}, adding --no-experimental-require-module option to child_process NODE_OPTIONS.`)
333333
tsNodeEsmLoader = `${tsNodeEsmLoader} --no-experimental-require-module`
334334
}

packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('ProjectConfigIpc', () => {
3838
context('forkChildProcess', () => {
3939
// some of these node versions may not exist, but we want to verify
4040
// the experimental flags are correctly disabled for future versions
41-
const NODE_VERSIONS = ['18.20.4', '20.17.0', '22.7.0', '22.11.4', '22.12.0', '22.15.0']
41+
const NODE_VERSIONS = ['18.20.4', '20.17.0', '20.19.0', '22.7.0', '22.11.4', '22.12.0', '22.15.0']
4242
const experimentalDetectModuleIntroduced = '22.7.0'
4343
const experimentalRequireModuleIntroduced = '22.12.0'
4444

0 commit comments

Comments
 (0)