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

Commit

Permalink
feat: update node version to 18 (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
biruwon authored Jun 1, 2023
1 parent 909a22a commit 881a185
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

1 comment on commit 881a185

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱ Benchmark results

  • largeDepsEsbuild: 2.2s
  • largeDepsNft: 8.2s
  • largeDepsZisi: 15.3s

Please sign in to comment.