Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: update node version to 18 #1444

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The following properties are accepted:
- `nodeVersion`

- _Type_: `string`\
- _Default value_: `16`
- _Default value_: `18`

The version of Node.js to use as the compilation target for bundlers. This is also used to determine the runtime
reported in the manifest. Any valid and supported Node.js version is accepted. Examples:
Expand Down Expand Up @@ -478,9 +478,9 @@ need to be the same as the one used when installing those native modules.

In Netlify, this is done by ensuring that the following Node.js versions are the same:

- Build-time Node.js version: this defaults to Node `16`, but can be
- Build-time Node.js version: this defaults to Node `18`, but can be
[overridden with a `.nvmrc` or `NODE_VERSION` environment variable](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript).
- Function runtime Node.js version: this defaults to `nodejs16.x` but can be
- Function runtime Node.js version: this defaults to `nodejs18.x` but can be
[overridden with a `AWS_LAMBDA_JS_RUNTIME` environment variable](https://docs.netlify.com/functions/optional-configuration/?fn-language=js#node-js-version-for-runtime-2).

Note that this problem might not apply for Node.js native modules using the [N-API](https://nodejs.org/api/n-api.html).
Expand Down
2 changes: 1 addition & 1 deletion src/runtimes/node/utils/node_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface NodeVersionSupport {
}

// Must match the default version used in Bitballoon.
export const DEFAULT_NODE_VERSION = 16
export const DEFAULT_NODE_VERSION = 18

export const getNodeVersion = (configVersion?: string) => parseVersion(configVersion) ?? DEFAULT_NODE_VERSION

Expand Down
1 change: 1 addition & 0 deletions tests/unit/runtimes/node/utils/node_version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('getNodeVersion', () => {
['nodejs14.x', 14],
['nodejs12.x', 12],
['nodejs16.x', 16],
['nodejs18.x', 18],
['18.x', 18],
['node16', 16],
['14.1.1', 14],
Expand Down