AWS Lambda
Runtime.ImportModuleError: Error: Cannot find module
Lambda can't load a dependency your handler imports — most often after a runtime upgrade changed what's bundled.
Common right after changing the runtime: (1) on nodejs18+ the AWS SDK v2 ('aws-sdk') is no longer preinstalled — only @aws-sdk v3 is; (2) the deployment bundle omitted a dependency; (3) a Lambda layer was built on a different OS/architecture; or (4) a native binary needs a different glibc. The handler then throws ImportModuleError at cold start.
Related deadline: Lambda Node.js 18 create/update restrictions — 2027-02-01.
The free EOLkits scanner processes files in your browser and flags selected related patterns in supported IaC and dependency files. File names and contents are not uploaded; bounded aggregate file and finding counts may be sent. It is not a complete source or AWS-account scan.
Prefer a 10-second check? Paste your config into the free AWS EOL checker. Pasted input is not uploaded; bounded first-party usage events may be sent.
Primary source: https://repost.aws/knowledge-center/lambda-import-module-error-nodejs