Serverless Framework warns that a Node.js runtime is unsupported or deprecated
Warning: found unsupported runtime 'nodejs18.x' for functionShort 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.
Fix it fast
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/null2Match what you see, then jump to its fix
- 1
The warning names nodejs18.x (or nodejs20.x) and a deprecation dateprovider.runtime names a deprecated Lambda runtimeFix - 2
The provider is already updated, yet the warning names a single functionOne function overrides the provider runtimeFix - 3
The warning appears and grep finds no runtime line at allNo runtime is set, so the Framework default appliesFix - 4
Deploys of an old runtime start failing, not just warningUpdates are close to being blocked by LambdaFix
- 1
What does the error look like?
Warning: found unsupported runtime 'nodejs18.x' for functionUnsupported 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.yml2Fix
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.x3Verify
Package the service. The warning is gone.
npx serverless packageConfirmed by docs.aws.amazon.com
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.yml2Fix
Remove the old override, or set it to a supported identifier.
functions:
api:
handler: src/api.handler
# runtime line removed: inherits provider.runtime3Verify
Package again and read the output for warnings.
npx serverless packageConfirmed by serverless.com
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.yml2Fix
Set provider.runtime explicitly, so the version is your decision and not the default's.
provider:
runtime: nodejs24.x3Verify
Deploy to a test stage and invoke a function.
npx serverless deploy --stage dev
npx serverless invoke --function api --stage devConfirmed by serverless.com
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.x3Verify
List functions again. None should show the old runtime.
aws lambda list-functions --query "Functions[].[FunctionName,Runtime]"Confirmed by docs.aws.amazon.com
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
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 fixBack end
Application Load Balancer returns 502 for a Node.js target
HTTPCode_ELB_502_Count
An ALB returns 502 when the target gives it something it cannot use: a refused or reset connection, a connection closed mid-request, a bad response, or a header over 32 K.
4 causes, each with a fixBack 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 fixBack 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 fixBack end
AWS SDK for JavaScript v3 cannot find credentials, even for DynamoDB Local
A DynamoDB client pointed at http://localhost:8000 fails with the same message
The SDK walked its default credential provider chain and found nothing.
3 causes, each with a fixBack end
AWS SDK says the security token included in the request is invalid
The security token included in the request is invalid
The call reached AWS but the credentials it carried were refused.
3 causes, each with a fix