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-07-29.
Fixing one function by hand rarely clears the whole stack. Download the $79 Offline Migration & Audit Toolkit to run air-gapped repo/IaC audits, Python 3.12/3.13 & AWS SDK v3 codemods, AL2023 native wheel Dockerfiles, and canary rollback templates with zero source upload (US buyers only · 30-day full refund policy).
Buy $79 Offline Toolkit (Instant Download) → Full specs & sample
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