Skip to content

Commit 5b3b565

Browse files
authored
chore: More Node 18 bumps (#36640)
1 parent 9e3f160 commit 5b3b565

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

packages/gatsby-cli/src/__tests__/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const setup = (version?: string): ReturnType<typeof getCLI> => {
5252
}
5353

5454
describe(`error handling`, () => {
55+
// TODO(v5): Update test to handle Node 18
5556
it(`panics on Node < 14.15.0`, () => {
5657
;[`6.0.0`, `8.0.0`, `12.13.0`, `13.0.0`].forEach(version => {
5758
const { reporter } = setup(version)

packages/gatsby-cli/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ if (os.platform() === `win32`) {
2323
// Check if update is available
2424
updateNotifier({ pkg }).notify({ isGlobal: true })
2525

26-
const MIN_NODE_VERSION = `14.15.0`
26+
// @ts-ignore - TODO: Remove _CFLAGS_ again
27+
const MIN_NODE_VERSION = _CFLAGS_.GATSBY_MAJOR === `5` ? `18.0.0` : `14.15.0`
2728
// const NEXT_MIN_NODE_VERSION = `10.13.0`
2829

2930
const { version } = process

packages/gatsby/src/utils/parcel/compile-gatsby-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function constructParcel(siteRoot: string, cache?: Cache): Parcel {
4343
includeNodeModules: false,
4444
sourceMap: false,
4545
engines: {
46-
node: `>= 14.15.0`,
46+
node: _CFLAGS_.GATSBY_MAJOR === `5` ? `>= 18.0.0` : `>= 14.15.0`,
4747
},
4848
distDir: `${siteRoot}/${COMPILED_CACHE_DIR}`,
4949
},

0 commit comments

Comments
 (0)