Skip to content
Latchkey

Node ERR_INTERNAL_ASSERTION in CI - Diagnose the Internal Failure

ERR_INTERNAL_ASSERTION is an internal invariant failure inside Node itself, usually triggered by a bug in Node, a native addon, or memory corruption.

What this error means

A node process crashes in CI with Error [ERR_INTERNAL_ASSERTION] and a message that this is likely a bug in Node.js, pointing at internal code rather than yours.

node
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js
or incorrect usage of Node.js internals.
Please open an issue with this stack trace at
https://github.com/nodejs/node/issues
    at new NodeError (node:internal/errors:387:5)

Common causes

A bug in the running Node version

A specific Node release has an internal invariant that fails for some inputs; another version does not.

A native addon corrupting internal state

A misbehaving native module violates Node internal expectations, tripping the assertion.

How to fix it

Pin a different Node version

  1. Switch the CI Node version to a known-good release.
  2. Re-run to see if the internal assertion clears.
GitHub Actions
- uses: actions/setup-node@v4
  with:
    node-version: 20.18.0

Isolate or update the native addon

  1. Disable the suspect native dependency to confirm it is the trigger.
  2. Upgrade it or replace it with a pure-JS alternative.

How to prevent it

  • Pin and test Node version upgrades, keep native addons current, and report reproducible internal assertions upstream with the stack trace.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →