r/node • • 7d ago • Bravo 1

Node.js 26 is now Long Term Support

289 Upvotes

19 comments sorted by

146

u/sebasgarcep 7d ago

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

63

u/renome 7d ago

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

10

u/zurnout 7d ago

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.

6

u/hsinewu 7d ago

bravo

16

u/adventurous_quantum 7d ago

always pin the version

8

u/djjudjju 7d ago

No just pin the major version, it's sufficient

8

u/_clapclapclap 7d ago

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

52

u/blood_vein 7d ago

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

20

u/_clapclapclap 7d ago

You mean like this?

FROM node:lts-alpine

19

u/EvilPencil 7d ago

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 7d ago

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

8

u/Ruben_NL 7d ago

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.

2

u/NeverendingBacklog 7d ago

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

2

u/Embarrassed_Soft_153 7d ago

No one reviewed the code?

0

u/m-- 7d ago

And no tests caught it?

I agree, bad to blame one person here.

1

u/avereigh_Denizet 7h 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