I have now submitted
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2150093 and
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2150094 for the
`nodejs16` and `nodejs18` packages for Fedora.
You can test them with `dnf copr enable sgallagh/nodejs-alternatives`.
The final approach I took is one that follows the example of Python3.
The SRPM is versioned according to the major release number and the
output binary RPMs will be `nodejs[-*]` if it is the default version
for that release or `nodejs$MAJOR[-*]` if not.
I've tested the upgrade path from F36 and F37 and it appears to work
fine (and could, in fact, trivially be backported to the live releases
to simplify maintenance).
I'd appreciate package reviews from anyone with the available time. Thank you.