
Graceful shutdown in Node.js: SIGTERM, Docker, Kubernetes
Graceful shutdown in Node.js with SIGTERM, Express server draining, Docker stop behavior, Kubernetes readiness, and safe cleanup for databases, Redis, and queues.

Graceful shutdown in Node.js with SIGTERM, Express server draining, Docker stop behavior, Kubernetes readiness, and safe cleanup for databases, Redis, and queues.
| Error | What it means / fix |
|---|---|
| ERR_HEAP_OUT_OF_MEMORY | Fix JavaScript heap out of memory in Node.js Fix JavaScript heap out of memory in Node.js with V8 heap flags, Docker limits, heap snapshots, RSS checks, and the leak triage I use in production. |
| UnhandledPromise | Express.js async error handling that actually works in 2026 Express.js async error handling that actually works in 2026: Express 5 native catching, the express-async-errors patch for legacy apps, typed error classes, and the Sentry integration that survives a bad deploy. |
| MODULE_NOT_FOUND | Fix “Cannot find module” in Node.js (CommonJS, ES modules, TypeScript) Fix Cannot find module in Node.js: CommonJS vs ESM resolution rules, TypeScript path aliases at runtime, file case-sensitivity, monorepo workspace pitfalls, and the diagnostic tree I hand new engineers. |
| EADDRINUSE | Fix EADDRINUSE: address already in use in Node.js (Mac, Linux, Windows) Fix EADDRINUSE: address already in use in Node.js on Mac, Linux, and Windows. The kill commands per OS, the TIME_WAIT trap, graceful shutdown, and how to stop it from coming back. |

I've shipped APIs on all three. Sequelize from 2017 to 2020 on a payments API that's still in production. TypeORM through 2021 on a logistics dashboard, where the migration generator broke twice and burned a sprint each time.…