Installation on Fedora
Fedora maintains reasonably up-to-date Node.js packages in its official repositories. The command sudo dnf install -y nodejs installs the runtime along with npm. The executable is placed in /usr/bin/node. This is the simplest approach for a standard Fedora workstation.
Choosing a major version
On Fedora 41/42, the nodejs package provides 22.x by default. For another major version, install the matching versioned package: sudo dnf install nodejs20 or sudo dnf install nodejs24. The old DNF module streams (dnf module enable nodejs:22) are deprecated and removed under DNF5; they are no longer the recommended method. To switch the active version without conflicts, swap between the -bin packages with dnf swap, for example sudo dnf swap --allowerasing nodejs22-bin nodejs24-bin. To guarantee the latest LTS, the NodeSource RPM repository remains a reliable alternative.
Configuration
The user configuration for npm is stored in ~/.npmrc. Fedora's nodejs RPM does not include Corepack, so the corepack enable command is not available after a DNF install. To use pnpm or yarn, install them directly, or add Corepack separately with npm install -g corepack before running corepack enable.