devsetup1-6 Exercise 1: Deciding Which Node to Install ======================================================== STEP 1: THE CHAPTER 3 CHECKS ---------------------------- dpkg -s nodejs # "package 'nodejs' is not installed" on a fresh box command -v node # prints nothing if Node is absent type -a node # lists every copy on the PATH apt policy nodejs npm # what Debian offers Expected on a fresh Debian 13 desktop: nodejs and npm are not installed. apt policy shows a Candidate for nodejs of 20.19.2+dfsg-1+deb13uN (the last number rises as security updates arrive) and 9.2.0~ds1-3 for npm. If a Node is already present, note where it came from (dpkg -S "$(command -v node)"). STEP 2: THE FACTS THAT MATTER ----------------------------- - Debian's Node is 20.x. Upstream Node lists Node 20 as end of life on 30 April 2026. Debian still patches it, but it is an unmaintained upstream line. - As of 30 September 2026: Node 24 is Active LTS (Maintenance begins 20 October 2026, end of life 30 April 2028). Node 22 is Maintenance LTS (end of life 30 April 2027). Node 26 is Current and becomes LTS on 28 October 2026. - The Node project advises production use of Active or Maintenance LTS. STEP 3: THE DECISION (example answer) ------------------------------------- Install Node 24 through nvm, and make it the default. Reasons: 1. It is Active LTS: stable, supported until April 2028, and the natural target for libraries written today. 2. The Debian package (20.x) is behind upstream's supported range, so new projects would immediately be on an end-of-life line. 3. nvm lets several projects use different versions, which suits a development machine, and it lives in the home directory so it cannot disturb the system. 4. Not installing the Debian nodejs package avoids two copies of Node. WHAT WOULD CHANGE MY MIND ------------------------- - If debserver must run a specific version, install THAT version instead (or as well) and pin it in .nvmrc; matching the deployment target beats picking the newest. - If a project's dependencies do not yet support Node 24, use Node 22 for that project, via its .nvmrc. It is supported until April 2027. - If I only wanted a Node for a Debian tool that needs it, the apt package would be enough, and I would not use nvm at all for that purpose. - In late October 2026, when Node 26 becomes LTS, I would look at whether it is worth moving new projects to it. WHY THIS WORKS AS AN ANSWER --------------------------- It starts from checked facts, not habit, and states the conditions under which the decision would be different. Dates and version numbers are the kind of detail that changes, so the answer says where they came from and to recheck them.