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
--requireto--import. Plumbing only; see Environment variables for howNODE_OPTIONSis composed. - 22.15: Kratex gains an additional, earlier interception point at module resolution, so a blocked import can fail at
importtime; on older versions the same operation is blocked when used. One rule-authoring detail rides on this: rules that target thefficapability by name fire on 22.15+ only; on older versions those loads are caught undernative-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
- Commands reference → kratex doctor: the diagnostic that checks the 18.17 floor.
- Environment variables:
NODE_OPTIONSis composed bykratex runto inject the preload; options you set on the parent are forwarded. - Policy authoring → Target: runtime: the
runtime.capabilityoperations; theffilabel requires Node 22.15+. - Installation: installing the CLI and the 18.17 requirement.