From Fedora Project Wiki


Node.js 18.x by default

Important.png
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

The latest release of Node.js to carry a 30-month lifecycle is the 18.x series. As with 16.x, 14.x, 12.x, 10.x and 8.x before it, Fedora 37 will carry 18.x as the default Node.js interpreter for the system. The 16.x, and 14.x interpreters will remain available as non-default module streams.

Owner

Current status

  • Targeted release: Fedora 37
  • Last updated: 2022-05-03
  • devel thread
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

Fedora 37 will ship with the latest LTS version of Node.js. dnf install nodejs will give users nodejs-18.x and the matching npm package.

Benefit to Fedora

Node.js is a popular server-side JavaScript engine. Keeping Fedora on the latest release allows us to continue tracking the state-of-the-art in that space. For those whose applications do not yet work with the 18.x release, Fedora 37 will also have the 16.x and 14.x releases available as selectable module streams.

Scope

  • Proposal owners:

The packages are already built for Fedora 34, 35, and 36 in a non-default module stream. On June 6th, 2022, the nodejs-18.x packages will be built in the non-modular repository and thus become the default in Fedora 37.

  • Other developers: N/A (not a System Wide Change)

Any developer with a package that depends on Node.js at run-time or build-time should test with the 18.x module stream enabled as soon as possible. Issues should be reported to nodejs@lists.fedoraproject.org

We will coordinate with the Node.js SIG to create a side-tag to perform any necessary rebuilds before making 18.x the default.

  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

As with previous releases, users running Fedora 35 or Fedora 36 with the non-modular nodejs-16.x packages will be automatically upgraded to the 18.x packages when they upgrade to Fedora 37, which may cause compatibility issues. If users are running software known not to support Node.js 18.x yet, they can switch the system to use 16.x with dnf module commands.

How To Test

  • Confirm that dnf install nodejs results in Node.js 18.x being installed.
  • Confirm that upgrading from Fedora 35 or Fedora 36 with nodejs-16.x installed (non-modular) results in an upgrade to nodejs-18.x
  • Confirm that upgrading from Fedora 35 or Fedora 36 with the nodejs:16 module enabled does *not* result in an upgrade to 18.x and still has the nodejs:16 module enabled on Fedora 37.
  • Confirm that upgrading from Fedora 35 or Fedora 36 with the nodejs:18 module enabled upgrades successfully and still has the nodejs:16 module stream enabled on Fedora 37.

User Experience

Users will have the 18.x release of Node.js available by default. See the "Upgrade/compatibility impact" section for specific details.

Dependencies

All packages prefixed with nodejs- depend on this package. If they do not work with Node.js 16.x, they will need to be updated, made modular and dependent upon the nodejs:16 stream or else removed from Fedora 37.

Prior to the switchover date to Node.js 18.x as the default, packagers are strongly encouraged to test their existing Node modules with 18.x via the Modular version by running:

dnf module reset nodejs
dnf module install nodejs:18/development

Packagers can also test their builds using mock by creating the file /etc/mock/fedora-rawhide-x86_64-nodejs18.cfg with the following contents:

config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['enable_disable_repos'] = ['--enablerepo', 'rawhide-modular']
config_opts['module_install'] = ['nodejs:18/development']

include('templates/fedora-rawhide.tpl')

Then call

mock -r fedora-rawhide-x86_64-nodejs18 --enablerepo=rawhide-modular nodejs-foo

(Note that the --enablerepo=rawhide-modular portion looks redundant, but this is because of a mock bug)

Contingency Plan

  • Contingency mechanism: Revert to Node.js 16.x as the default Node.js interpreter. This will require bumping epoch.
  • Contingency deadline: Beta Freeze
  • Blocks release? No
  • Blocks product? No

Documentation

Release Notes

Fedora 37 now ships with Node.js 18.x as the default Node.js JavaScript server-side engine. If your applications are not yet ready for this newer version, you can revert to the 16.x series by running the following commands

dnf remove nodejs
dnf module reset nodejs
dnf module install nodejs:16