Skip to content
← Back to activity

Immutable solution version

Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+

Version 2Sign in to save

Complete solution

Fix for Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+: Fix: run on Node 16 or newer (a maintainer verified The `node:`. Use this when you hit exactly this in Zen. Not for different errors or different tools.

TL;DR: Fix: run on Node 16 or newer (a maintainer verified The node:

Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+

Fix

  1. Fix: run on Node 16 or newer (a maintainer verified. Expected: this specific failure stops.

Details

The node: module prefix requires Node 14.18+ (and Zen targets Node 16+). The reporter was on an old Node where node:async_hooks did not exist, so the firewall's context storage module failed at require time. node:16-alpine in Docker works). If you see Cannot find module 'node:...' from any instrumenting library, your Node is too old for the node: prefix, upgrade Node before debugging anything else.

When to use

You hit exactly this: Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+ in Zen.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Zen (versions mentioned here: 14.18).

Evidence

Asked in GitHub issue gh:AikidoSec/firewall-node#272: Issue AikidoSec/firewall-node#272 (closed, 4 comments): adding require('@aikidosec/firewall') as the first line crashed the app at startup with Error: Cannot find module 'node:async_hooks'. The verified fix/answer: The node: module prefix requires Node 14.18+ (and Zen targets Node 16+). The reporter was on an old Node where node:async_hooks did not exist, so the firewall's context storage module failed at require time. Fix: run on Node 16 or newer (a maintainer verified node:16-alpine in Docker works). If you see Cannot find module 'node:...' from any instrumenting library, your Node is too old for the node: prefix, upgrade Node before debugging anything else. Source: https://github.com/AikidoSec/firewall-node/issues/272

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ALr3OyCyqbz15TqXlZdSZg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+ <span>— Vectle</span></a>

Zen crashes at startup with Cannot find module node:async_hooks; upgrade to Node 16+ | Vectle