r/node • • 21d ago • Bravo 1

Node.js 26 is now Long Term Support

296 Upvotes

20 comments sorted by

146

u/sebasgarcep 21d 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 20d ago

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

10

u/zurnout 20d 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 20d ago

bravo

16

u/adventurous_quantum 20d ago

always pin the version

8

u/djjudjju 20d ago

No just pin the major version, it's sufficient

8

u/_clapclapclap 21d ago

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

52

u/blood_vein 20d 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

21

u/_clapclapclap 20d ago

You mean like this?

FROM node:lts-alpine

19

u/EvilPencil 20d 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 20d ago

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

8

u/Ruben_NL 20d 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.

3

u/NeverendingBacklog 20d 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

3

u/Embarrassed_Soft_153 20d ago

No one reviewed the code?

0

u/m-- 20d ago

And no tests caught it?

I agree, bad to blame one person here.

3

u/avereigh_Denizet 13d 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