Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
os: [windows-latest]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['18.14.0', '20.12.2', '22']
node-version: ['20.12.2', '22']
fail-fast: false
steps:
# This improves Windows network performance. We need this since we open many ports in our tests.
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
node-version: ['18.14.0', '22']
node-version: ['20.12.2', '22']
fail-fast: false
steps:
- name: Git checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: 20.12.2
cache: npm

- name: Install dependencies
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
# Pinning 20.x version as a temporary workaround due to this https://github.com/nodejs/node/issues/52884
node-version: ['18.17.0', '20.12.2', '22']
node-version: ['20.12.2', '22']
shard: ['1/4', '2/4', '3/4', '4/4']

exclude:
- os: macOS-latest
node-version: '18.17.0'
- os: windows-latest
node-version: '18.17.0'
- os: windows-latest
node-version: '22'
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: 20.12.2
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-sha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '18.17.0'
node-version: '20.12.2'
cache: npm
registry-url: 'https://registry.npmjs.org'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: 20.12.2
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['18.14.0', '22.x']
node-version: ['20.12.2', '22.x']
exclude:
- os: windows-latest
node-version: '22.x'
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ See the [CLI command line reference](https://cli.netlify.com/commands/) to get s

## Installation

Netlify CLI requires [Node.js](https://nodejs.org) version 18.14.0 or above. To install, run the following command from any
directory in your terminal:
Netlify CLI requires [Node.js](https://nodejs.org) version 20.12.2 or above. To install, run the following command from
any directory in your terminal:

```bash
npm install netlify-cli -g
Expand Down Expand Up @@ -87,7 +87,6 @@ netlify [command] help
To learn how to log in to Netlify and start deploying projects, visit the
[documentation on Netlify](https://docs.netlify.com/cli/get-started/).


## Commands

For a full command reference visit [cli.netlify.com](https://cli.netlify.com/).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Netlify Inc.",
"type": "module",
"engines": {
"node": ">=18.14.0"
"node": ">=20.12.2"
},
"files": [
"/bin",
Expand Down
4 changes: 2 additions & 2 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/functions/netlify-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type InvokeFunctionResultWithSuccess = { error: null; result: InvokeFunct
export type InvokeResult = InvokeFunctionResultWithError | InvokeFunctionResultWithSuccess

const TYPESCRIPT_EXTENSIONS = new Set(['.cts', '.mts', '.ts'])
const V2_MIN_NODE_VERSION = '18.14.0'
const V2_MIN_NODE_VERSION = '20.12.2'
Copy link
Member

Choose a reason for hiding this comment

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

This is technically not needed, since the minimum version needed to have V2 functions (with Request/Response) is still the same. It just happens that this version is now lower than the minimum version supported by the CLI.

This means that this constant and the isSupported() method that uses it can go away. But we can do that in a follow-up.


// See https://github.com/microsoft/TypeScript/issues/54451.
// Omit<A | B> does not work as you'd expect. This does.
Expand Down
2 changes: 1 addition & 1 deletion src/utils/nodejs-compile-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export let didEnableCompileCache = false
* user's disk in a temp dir. If any of these changes or the temp dir is cleared, the next run is a cold run.
*
* The programmatic API to enable this (`enableCompileCache()`) was added in node 22.8.0, but we currently support
* >=18.14.0, hence the conditional below. (For completeness, note that support via the env var was added in 22.1.0.)
* >=20.12.2, hence the conditional below. (For completeness, note that support via the env var was added in 22.1.0.)
*
* The Netlify CLI is often used in CI workflows. In this context, we wouldn't want the overhead of the first run
* because we almost certainly would not get any benefits on "subsequent runs". Even if the user has configured caching
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/commands/dev/dev.config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe.concurrent('commands/dev/config', () => {
})
})

test.runIf(gte(version, '18.14.0'))('should support functions with streaming responses', async (t) => {
test.runIf(gte(version, '20.12.2'))('should support functions with streaming responses', async (t) => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this anymore because now the lowest version we test with has support for Request/Response, which is what this condition was about.

Suggested change
test.runIf(gte(version, '20.12.2'))('should support functions with streaming responses', async (t) => {
test('should support functions with streaming responses', async (t) => {
await withSiteBuilder(t, async (builder) => {
builder
.withPackageJson({ packageJson: { dependencies: { '@netlify/functions': 'latest' } } })
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/commands/dev/v2-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const setup = async ({ fixture }: { fixture: { directory: string } }) => {
await execa('npm', ['install'], { cwd: fixture.directory })
}

describe.runIf(gte(version, '18.13.0')).concurrent('v2 api', async () => {
describe.runIf(gte(version, '20.12.2')).concurrent('v2 api', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this anymore because now the lowest version we test with has support for Request/Response, which is what this condition was about.

Suggested change
describe.runIf(gte(version, '20.12.2')).concurrent('v2 api', async () => {
describe.concurrent('v2 api', async () => {
await setupFixtureTests('dev-server-with-v2-functions', { devServer: true, mockApi: { routes }, setup }, () => {
test<FixtureTestContext>('should successfully be able to run v2 functions', async ({ devServer, expect }) => {
const response = await fetch(`http://localhost:${devServer!.port}/.netlify/functions/ping`)
Expand Down
Loading