Skip to content
Docs menu

Node.js compatibility

Kratex protects every Node version it supports: 18.17 and later.

Minimum version: 18.17

Node.js 18.17.0 or later is required. Nothing actively refuses to run below it: the only checks are the npm engines warning at install time and kratex doctor, which reports the version as unsupported and exits non-zero. Versions before 18.17 (including all of Node 16) are unsupported.

Version differences

Two thresholds change Kratex internals. Neither changes what is enforced.

  • 20.6: the preload flag Kratex injects into child processes switches from --require to --import. Plumbing only; see Environment variables for how NODE_OPTIONS is composed.
  • 22.15: Kratex gains an additional, earlier interception point at module resolution, so a blocked import can fail at import time; on older versions the same operation is blocked when used. One rule-authoring detail rides on this: rules that target the ffi capability by name fire on 22.15+ only; on older versions those loads are caught under native-addons.

What kratex doctor reports

kratex doctor validates the 18.17 floor. The output line is:

node: v22.14.0 ok

or, on an unsupported version:

node: v18.16.0 unsupported (requires Node 18.17+)

Doctor exits non-zero on an unsupported Node version.

See kratex doctor for the full diagnostic output.

LTS guidance

  • Node 18.x and 20.x: end of life (April 2025 and April 2026). Kratex protects them; upgrade anyway, since Kratex does not replace Node’s own security patches.
  • Node 22.x: Maintenance LTS.
  • Node 24.x: Active LTS; recommended.

Run a current LTS line for Node’s own sake.

See also