r/node • • Oct 29 '26 • Bravo 1

Node.js 26 is now Long Term Support

297 Upvotes

20 comments sorted by

147

u/sebasgarcep Oct 29 '26

Just found out the hard way. Our deployment to prod failed because the person who wrote the dockerfile pinned it to LTS 😭

64

u/renome Oct 29 '26

If you pin to long-term support you get long-term support, big brain move

10

u/zurnout Oct 29 '26

If someone’s wondering how to use the latest LTS version without breaking production, here’s a solution:

You pin the exact image but implement an automated process like Dependabot or Renovate to upgrade the version by changing the pinned image via a pull request. This ensures your CI pipeline checks for functionality before merging. Additionally, you should set rules to only suggest LTS upgrades.

16

u/adventurous_quantum Oct 29 '26

always pin the version

8

u/djjudjju Oct 29 '26

No just pin the major version, it's sufficient

8

u/_clapclapclap Oct 29 '26

I'm a noob. What does that mean? You mean they pinned it to 24? What was the fix?

52

u/blood_vein Oct 29 '26

It means the docker build will always pick LTS, so it suddenly jumped to 26 in that build and something mustve broken in the dependency chain

21

u/_clapclapclap Oct 29 '26

You mean like this?

FROM node:lts-alpine

19

u/EvilPencil Oct 29 '26

You should at the very least pin the major node version to prevent this exact issue.

In this case:
FROM node:24-alpine

What was done:
FROM node:lts-alpine

5

u/_clapclapclap Oct 29 '26

If I pin node:24-alpine, does it use LTS of version 24 automatically?

8

u/Ruben_NL Oct 29 '26

Yes. There is no "non-lts" version of a lts version.

Lts just means that node is promising to support it for a long time.

3

u/NeverendingBacklog Oct 29 '26

this is Node's release schedule... LTS means "Long Term Support"... if you had "some-node-build-lts" in your bundle you would pull one version on one day and another version on another day if those days hypothetically aligned with their release updates (which in the case of OP - it did). Based on that chart v26 is now LTS - so using a version of 26 "some-node-build-v26" in the shitty example above you would be using LTS but if node updates LTS to 28 bc of a CVE you won't jump to that automagically

3

u/Embarrassed_Soft_153 Oct 29 '26

No one reviewed the code?

0

u/m-- Oct 29 '26

And no tests caught it?

I agree, bad to blame one person here.

3

u/avereigh_Denizet 25d ago

good reminder to check your base container images and CI runners before bumping the version locally, native addon compatibility usually lags a few weeks behind the initial LTS tag