This is a searchable reference for Node.js error codes — both the structured ERR_* codes thrown by Node’s own APIs and the lower-case errno codes (like ENOENT and ECONNREFUSED) that bubble up from libuv and the operating system. Each row tells you which subsystem raised the error and what typically causes it.
How it works
Node attaches a stable string identifier to most errors via the error.code property. Two families exist. The first is Node’s own catalogue of ERR_* codes — for example ERR_INVALID_ARG_TYPE from argument validation, ERR_STREAM_WRITE_AFTER_END from the streams layer, or ERR_HTTP_HEADERS_SENT from the HTTP server. The second family is the POSIX-style errno codes that libuv surfaces unchanged from system calls, such as EACCES (permission denied) or EADDRINUSE (port already bound).
Because messages are free-form and can change between releases, robust code branches on error.code. The origin column in the table groups codes by their source layer (core, esm, stream, http, crypto, libuv, dns) so you can quickly tell whether a failure came from your arguments, the network, or the filesystem.
Example
Handle a missing file and a refused connection by code, not by message:
import { readFile } from "node:fs/promises";
try {
await readFile("./config.json");
} catch (err) {
if (err.code === "ENOENT") {
// file does not exist — fall back to defaults
} else if (err.code === "EACCES") {
// permission denied
} else {
throw err;
}
}
A network call that fails with err.code === "ECONNREFUSED" means nothing is listening on that host and port — a different problem from ETIMEDOUT, which means the connection attempt simply ran out of time. Everything runs in your browser; nothing is uploaded.