Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Serverless Framework warns that a Node.js runtime is unsupported or deprecated

ErrorWarning: found unsupported runtime 'nodejs18.x' for function

Short answer

AWS retired the managed Node.js 18 runtime (nodejs18.x) on 1 September 2025, and the Serverless Framework warns when any function uses a deprecated runtime. Change provider.runtime, and any function-level runtime, to a supported identifier such as nodejs22.x or nodejs24.x, then redeploy.

  • Applies to Serverless Framework, AWS Lambda, Node.js 22, Node.js 24
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find every place the service sets a runtime. The provider value is the default, and each function can override it.

    grep -n "runtime" serverless.yml serverless.yaml 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1The warning names nodejs18.x (or nodejs20.x) and a deprecation dateprovider.runtime names a deprecated Lambda runtimeFix
    2. 2The provider is already updated, yet the warning names a single functionOne function overrides the provider runtimeFix
    3. 3The warning appears and grep finds no runtime line at allNo runtime is set, so the Framework default appliesFix
    4. 4Deploys of an old runtime start failing, not just warningUpdates are close to being blocked by LambdaFix

What does the error look like?

  • Warning: found unsupported runtime 'nodejs18.x' for function
  • Unsupported runtime

Cause 1 of 4

provider.runtime names a deprecated Lambda runtime

1Check

The Lambda runtime table lists nodejs18.x as deprecated on Sep 1, 2025 and nodejs20.x as deprecated on Apr 30, 2026. nodejs22.x and nodejs24.x are supported. The Framework docs say package and deploy print a warning for a deprecated runtime.

grep -n -A3 "^provider:" serverless.yml

2Fix

Set a supported identifier at provider level. Move the code to that Node.js version first, since AWS cannot guarantee backward compatibility between major versions.

provider:
  name: aws
  runtime: nodejs22.x

3Verify

Package the service. The warning is gone.

npx serverless package

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 2 of 4

One function overrides the provider runtime

1Check

The Framework docs say a runtime set under a function overrides the provider value for that function only.

grep -n -B4 "runtime: nodejs1\|runtime: nodejs20" serverless.yml

2Fix

Remove the old override, or set it to a supported identifier.

functions:
  api:
    handler: src/api.handler
    # runtime line removed: inherits provider.runtime

3Verify

Package again and read the output for warnings.

npx serverless package

Confirmed by serverless.com

Did this fix it?

Cause 3 of 4

No runtime is set, so the Framework default applies

1Check

The Framework docs say the warning also covers functions that get the default runtime because neither the function nor provider sets one.

grep -c "runtime" serverless.yml

2Fix

Set provider.runtime explicitly, so the version is your decision and not the default's.

provider:
  runtime: nodejs24.x

3Verify

Deploy to a test stage and invoke a function.

npx serverless deploy --stage dev
npx serverless invoke --function api --stage dev

Confirmed by serverless.com

Did this fix it?

Cause 4 of 4

Updates are close to being blocked by Lambda

1Check

Lambda blocks creating functions, and then updating code and configuration, on set dates after deprecation. For nodejs18.x the table gives Jul 29, 2027 (create) and Aug 31, 2027 (update). Existing functions keep running.

aws lambda list-functions --query "Functions[?Runtime=='nodejs18.x'].FunctionName"

2Fix

Upgrade before the block date. After it, you can still change the function to a supported runtime, but you cannot go back.

provider:
  runtime: nodejs22.x

3Verify

List functions again. None should show the old runtime.

aws lambda list-functions --query "Functions[].[FunctionName,Runtime]"

Confirmed by docs.aws.amazon.com

Did this fix it?

How do I stop it coming back?

  • Check the Lambda supported-runtimes table when you plan each quarter, and upgrade before the deprecation date.
  • Set the runtime once under provider and avoid per-function overrides unless needed.
  • Run the same Node.js major locally and in CI as the Lambda runtime.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

API Gateway gives up on a slow Lambda or Node.js backend

$context.integrationErrorMessage in the access log shows the integration error

API Gateway stops waiting for the backend at its integration timeout: 29 seconds by default on REST APIs, a fixed 30 seconds on HTTP APIs.

4 causes, each with a fix

Back end

cdk synth says --app is required

--app is required either in command-line, in cdk.json or in ~/.cdk.json

The CDK CLI needs a command that runs your app and finds it in three places: the --app option, cdk.json in the project folder, or cdk.json in your home folder.

3 causes, each with a fix

Back end

The AWS SDK in Node.js cannot find any credentials

Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

The AWS SDK walks a fixed credential chain: code, environment variables, the shared files in ~/.aws, then role sources such as ECS or EC2.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.