Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js
Building Lambda functions with Node.js - AWS Lambda
For example, to enable ES module require support, set NODE_OPTIONS to --experimental-require-module. Lambda detects this override and removes the corresponding disable flag. Using experimental features can lead to instability and performance issues. These features might be changed or removed ...
Node.js 18.x runtime now available in AWS Lambda
This is great. My dream feature for lambda is JIT typescript compilation during container startup, so that it can natively run Typescript More on reddit.com
How to use Node.js 18 as Lambda (NodejsFunction) runtime?
Apparently it is not possible to set the runtime of a Lambda function to Node.js 18 as of now (@aws-cdk/aws-lambda@1.186.0). When will this be possible and are there any workarounds for now? More on github.com
amazon web services - Upgrading AWS Lambda Scripts from Node.js 16.x to 18.x with Minimal Changes - Stack Overflow
I have a collection of 15-20 scripts running on AWS Lambda with Node.js 16.x that perform various operations, including interacting with S3 using functions like copy, headObject, putObject, and get... More on stackoverflow.com
node.js - Lambda function cant load AWS sdk after switching to 18.x - Stack Overflow
I upgraded my Lambda function from node12.x to node18.x The code worked perfectly fine on 12.x, after switching to 18.x, I can no longer include the AWS sdk: I used to include it by simply typing: ... More on stackoverflow.com
Videos
08:11
Deploy a Node App to AWS Lambda Using Terraform - YouTube
07:49
Seamlessly Upgrading AWS Lambda Functions to Node.js 18 or 20: ...
AWS Lambda Layers + NodeJS | Sharing Code Between ...
00:34
AWS Lambda's NEW Feature: Fixes Node.js Problems! #shorts - YouTube
29:00
Complete Guide to AWS Lambda Function with Node Js, AWS Api Gateway ...
- YouTube
ECR Public Gallery
gallery.ecr.aws › lambda › nodejs
AWS Lambda/nodejs - Amazon ECR Public Gallery
Amazon ECR Public Gallery is a website that allows anyone to browse and search for public container images, view developer-provided details, and see pull commands
AWS
aws.amazon.com › about-aws › whats-new › 2022 › 11 › aws-lambda-support-node-js-18
AWS Lambda adds support for Node.js 18 - AWS
November 18, 2022 - To deploy Lambda functions using Node.js 18, upload the code through the Lambda console and select the Node.js 18 runtime. You can also use the AWS CLI, AWS Serverless Application Model (AWS SAM) and AWS CloudFormation to deploy and manage serverless applications written in Node.js 18.
Businesscompassllc
businesscompassllc.com › home
Seamlessly Upgrading AWS Lambda Functions to Node.js 18 or 20: A Step-by-Step Guide - Business Compass LLC®
August 30, 2024 - Node.js 18+ defaults to ESM, which changes how you handle modules in your Lambda functions. Adjusting File Extensions and Import/Export Syntax: To use ESM, you’ll need to update your file extensions from .js to .mjs (or define “type”: “module” in your package.json). Additionally, replace require statements with the import syntax and update export statements to use the export keyword. Migrating from AWS SDK v2 to v3 for Compatibility with Node.js 18/20
InfoQ
infoq.com › news › 2022 › 11 › aws-lambda-nodejs-18-support
AWS Lambda Now Has Support for Node.js 18 Runtime - InfoQ
November 28, 2022 - AWS Lambda supports the current Long Term Support (LTS) version of Node.js, which means developers who want to use the new versions need to specify a runtime parameter value of nodejs18.x when creating or updating functions or using the appropriate managed runtime base image. Furthermore, the Node.js 18 runtime is supported by functions running on either Arm-based AWS Graviton2 or x86-based processors.
Medium
mykeels.medium.com › upgrading-aws-lambda-to-node-18-44a2399450b1
Upgrading AWS Lambda to Node@18. So you have AWS Lambda in production… | by Michael Ikechi | Medium
March 1, 2023 - If you use cloudformation, this means changing to "Runtime": "nodejs18.x". Update your CI/CD pipelines to build with node version 18.14.2 . If you use Webpack, I’ve found webpack 5.75 works great for building project written for node@18. If your project uses aws-sdk v2, you will want to consider that the AWS lambdanodejs18.x runtime comes built-in with version 3.188.0 of the aws-sdk, which is v3, so you need to make a decision about your projects.
Reddit
reddit.com › r/node › node.js 18.x runtime now available in aws lambda
r/node on Reddit: Node.js 18.x runtime now available in AWS Lambda
November 21, 2022 - Ideally the code would be transpiled when lambda creates a new "container" not each time the function runs. There would still be a cost like you mentioned, but for a lot of serverless fucntions cold start times aren't that big of an issue. ... Yeah, our example was for a full blown api service connecting to a database and a few other services.
Stack Overflow
stackoverflow.com › questions › 78415947 › upgrading-aws-lambda-scripts-from-node-js-16-x-to-18-x-with-minimal-changes
amazon web services - Upgrading AWS Lambda Scripts from Node.js 16.x to 18.x with Minimal Changes - Stack Overflow
aws-lambda · aws-sdk-nodejs · Share · Improve this question · Follow · asked May 1, 2024 at 20:57 · Trickyan · 2133 bronze badges · Add a comment | Sorted by: Reset to default · Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) -1 · TL;DR There are automated codemod scripts that might help you out here · Part of the issue with upgrading from 16 to 18/20 is that aws-sdk has upgraded to v3 ·
Top answer 1 of 3
20
The Node.js 18 Lambda runtime is preloaded with the AWS SDK for JS v3.
The earlier runtimes have the SDK v2.
Of course you can still use the SDK v2 with the Node.js 18 runtime. You just need to package the clients as dependencies with your Lambda code.
The v2 SDK's aws-sdk package (preloaded on the 14.x, 16.x Lambda Node.js runtimes) contains every client. The v3 service clients (preloaded on 18.x) are modularised in separate @aws-sdk/client-[something] packages. Here's a v3 sample import for getting an S3 object:
// v3
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3"
See the Getting Started guide in the SDK v3 docs.
2 of 3
1
Install the aws-sdk in your lambda's package.json file.
npm install aws-sdk@2
Pegasus One
pegasusone.com › home › how to use aws lambda function in node.js
How to Use AWS Lambda Function in Node.js - Pegasus One
February 6, 2026 - AWS Lambda supports several Node.js versions (e.g., Node.js 18.x, 16.x).
AWS
aws.amazon.com › blogs › developer › why-and-how-you-should-use-aws-sdk-for-javascript-v3-on-node-js-18
Why and how you should use AWS SDK for JavaScript (v3) on Node.js 18 | AWS Developer Tools Blog
November 18, 2022 - // example.ts import AWS from "aws-sdk"; const region = "us-west-2"; const client = new AWS.DynamoDB({ region }); client.listTables({}, (err, data) => { if (err) console.log(err, err.stack); else console.log(data); });
Amazon Web Services
docs.aws.amazon.com › aws lambda › developer guide › building lambda functions with node.js › define lambda function handler in node.js
Define Lambda function handler in Node.js - AWS Lambda
You can configure Node.js in Lambda to detect automatically whether a .js file should be treated as CommonJS or as an ES module by adding the —experimental-detect-module flag to the NODE_OPTIONS environment variable. For more information, see Experimental Node.js features. The following examples show function handlers written using both ES modules and CommonJS modules. The remaining examples on this page all use ES modules. ... const url = "https://aws.amazon.com/"; export const handler = async(event) => { try { const res = await fetch(url); console.info("status", res.status); return res.status; } catch (e) { console.error(e); return 500; } };
Top answer 1 of 2
1
you can see Deploy Node.js Lambda functions with .zip file archives for details:
Runtime dependencies in Node.js:
> Lambda periodically updates the SDK libraries in the Node.js runtime to include the latest features and security upgrades. Lambda also applies security patches and updates to the other libraries included in the runtime. To have full control of the dependencies in your package, you can add your preferred version of any runtime-included dependency to your deployment package. For example, if you want to use a particular version of the SDK for JavaScript, you can include it in your .zip file as a dependency. For more information on adding runtime-included dependencies to your .zip file, see Dependency search path and runtime-included libraries.
Dependency search path and runtime-included libraries
:
> The Node.js runtime includes a number of common libraries, as well as a version of the AWS SDK for JavaScript. If you want to use a different version of a runtime-included library, you can do this by bundling it with your function or by adding it as a dependency in your deployment package ....
> By default, the first location the runtime searches is the directory into which your .zip deployment package is decompressed and mounted (/var/task). If you include a version of a runtime-included library in your deployment package, this version will take precedence over the version included in the runtime
>When you add a dependency to a layer, Lambda extracts this to /opt/nodejs/nodexx/node_modules where nodexx represents the version of the runtime you are using. In the search path, this directory has precedence over the directory containing the runtime-included libraries (/var/lang/lib/node_modules). Libraries in function layers therefore have precedence over versions included in the runtime.
So you have three choices:
1. Use the original aws sdk js v3 sdk from AWS Lambda Nodejs runtime, and do not include any content of aws sdk js v3 sdk in your own zip package
2. Use your preferred SDK version and include it in the zip package
2. Use your preferred SDK version by use layer,so your preferred SDK version has precedence over the directory containing the runtime-included libraries
2 of 2
0
Hello.
The version listed in that document is the version of the SDK included with the runtime.
So, if you want to use the latest version, you need to create a Lambda layer.
The SDK version requirements are listed on GitHub below.
https://github.com/aws/aws-sdk-js-v3
> v3.201.0 and higher requires Node.js >= 14.
> v3.46.0 to v3.200.0 requires Node.js >= 12.
> Earlier versions require Node.js >= 10.
Medium
medium.com › @antiquark007 › deploying-node-js-apps-on-aws-a-complete-guide-using-lambda-and-ec2-80c3cc2e23de
Deploying Node.js Apps on AWS: A Complete Guide Using Lambda and EC2 | by ved prakash singh | Medium
July 31, 2025 - Runtime: Node.js 18.x · Handler: index.handler · Execution Role: Create or select one with basic Lambda permissions · Upload function.zip in the console or via AWS CLI: aws lambda create-function \ --function-name myLambdaApp \ --zip-file fileb://function.zip \ --handler index.handler \ --runtime nodejs18.x \ --role arn:aws:iam::<your-account-id>:role/<lambda-role> Add an HTTP API Gateway ·
AWS re:Post
repost.aws › knowledge-center › lambda-layer-aws-sdk-latest-version
Integrate the AWS SDK for JavaScript into a Node.js Lambda function | AWS re:Post
April 28, 2025 - Also, make sure that you're using the most recent AWS CLI version. ... Note: Use this method only for Node.js versions 16 and earlier. Create a function in the Lambda console.