Node.js 24

Error: The module was compiled against a different Node.js version using NODE_MODULE_VERSION

Error: The module was compiled against a different Node.js version using NODE_MODULE_VERSION

What it means

A precompiled native addon was built for a different Node.js ABI than the one now running.

Why it happens

Native Node addons (sharp, bcrypt, better-sqlite3, canvas, …) are tied to the Node major version's ABI (NODE_MODULE_VERSION). Upgrading the Lambda/container runtime to Node.js 24 without rebuilding or updating these packages can trigger the mismatch.

How to fix it

  1. Rebuild native modules against the new Node version: `rm -rf node_modules && npm install` (or `npm rebuild`).
  2. Check the package's current support matrix and upgrade to a release that explicitly supports Node.js 24; rebuild on the target OS and architecture.
  3. Replace unmaintained native packages such as node-sass, fibers, and grpc with maintained alternatives (sass, native timers, @grpc/grpc-js).
  4. Build the deployment package on the same Node major version Lambda will run.

Related deadline: Lambda Node.js 20 create/update restrictions2027-02-01.

Check configured patterns in your project

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://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Inspect the $299 report sample and availability →