Node.js API Best Practices

Chapter 1 · Practice 1 of 4

Run an Active or Maintenance LTS release of Node.js

From Project structure and configuration

Why it matters

Your API should run on a Node.js line that still gets security fixes. The Node.js project says production apps should use only Active LTS or Maintenance LTS releases; odd-numbered and Current releases are for trying new features.

LineStatus as of October 2026
Node.js 24Active LTS until October 20, 2026, then Maintenance until April 2028
Node.js 26Becomes LTS on October 28, 2026
Odd numbers (25, 27)Never LTS: not for production

Keep every environment on the same line:

  • Pin the major version in engines in package.json.
  • Use the same major in your Dockerfile base image.
  • Use it again in CI.

Do

  • Set "engines": { "node": ">=24" } and match it in your Docker image
  • Add a reminder for each LTS end-of-life date

Avoid

  • Odd-numbered releases such as 25 or 27 in production