Node.js 22

[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. The warning appears on Node 18+ and is loudest on Node 22, often emitted by a transitive dependency.

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 EOL2027-02-01.

Find every instance in your project

The free EOLkits scanner runs in your browser (nothing uploaded) and flags this and related breakages across your IaC and dependency files.

Primary source: https://nodejs.org/api/punycode.html

Get the full migration audit — $299, hash-anchored PDF →