Node.js 24

[DEP0040] DeprecationWarning: The `punycode` module is deprecated

[DEP0040] DeprecationWarning: The `punycode` module is deprecated

What it means

The built-in punycode module is deprecated (DEP0040) and is slated for removal.

Why it happens

Node deprecated the built-in punycode module in favor of the userland package. DEP0040 became a runtime deprecation in Node.js 21, so current runtimes can emit it when code or a transitive dependency imports the built-in module.

How to fix it

  1. In your own code, depend on the userland package: `npm install punycode` then `require('punycode/')` (note the trailing slash).
  2. If it comes from a dependency, upgrade it — many libraries have dropped the built-in punycode.
  3. Find the source with `node --trace-deprecation`.
  4. It is a warning, not a breaker — but resolve it before the module is removed in a future major.

Related deadline: Lambda Node.js 18 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://nodejs.org/api/punycode.html

Inspect the $299 report sample and availability →