Fedora’s repositories make it easy to get a stable Node.js baseline, but JavaScript projects often need a newer LTS line or multiple majors side by side. To install Node.js on Fedora without mixing package sources, choose between Fedora’s DNF package, NodeSource’s RPM repository, or NVM for per-project version switching.
On Fedora 43, the distro package installs Node.js 22.22.x with npm 10.9.x, NodeSource currently offers 24.14.x and 25.8.x, and NVM can pull any supported release into your home directory. The same workflow also covers version checks, updates, troubleshooting, and removal.
Install Node.js on Fedora
Three paths cover most Fedora setups:
| Method | Channel | Version | Updates | Best For |
|---|---|---|---|---|
| Fedora DNF | Fedora repositories | 22.22.x | Automatic with dnf upgrade | Stable, distro-managed installs |
| NodeSource RPM | NodeSource | 22.22.x, 24.14.x, or 25.8.x | Automatic with dnf upgrade | Newer upstream LTS or Current releases |
| Node Version Manager (NVM) | NVM | Any supported major | Manual with nvm install | Per-project version switching |
- Use Fedora DNF when Node.js 22.x fits your stack and you want fully distro-managed updates.
- Use NodeSource when you want Node.js 24.x LTS or 25.x Current in
/usr/bin/node. - Use NVM when different projects need different Node.js majors on the same Fedora host.
Before installing Node.js, refresh Fedora’s package metadata and apply any pending updates:
sudo dnf upgrade --refresh -y
These commands use
sudofor package management tasks. If your account is not configured for administrative access yet, follow the guide on how to add a user to sudoers on Fedora first.
Methods 2 and 3 use curl. Fedora Workstation usually already includes it, while Server or minimal installs may need it first:
sudo dnf install curl -y
Install Node.js from Fedora DNF Repository
The Fedora package is the simplest path when you want Node.js managed entirely through DNF. Installing nodejs also pulls in Fedora’s nodejs-npm package, so npm is ready without a second install command.
sudo dnf install nodejs -y
Verify the runtime, npm, and installed package names:
node --version
npm --version
rpm -q nodejs nodejs-npm
v22.22.0 10.9.4 nodejs-22.22.0-2.fc43.x86_64 nodejs-npm-10.9.4-1.22.22.0.2.fc43.x86_64
Fedora 43 currently ships Node.js 22.22.x, which is the Maintenance LTS line (Jod). If you need the newer Active LTS stream (24.x) or the Current stream (25.x), use the NodeSource method or NVM instead. Confirm lifecycle changes at the official Node.js release schedule.
Install Node.js from NodeSource on Fedora
NodeSource is the cleanest system-wide option when Fedora’s default Node.js line is too old for your project. The current Fedora workflow uses the official setup_*.x script, which writes the repository files to /etc/yum.repos.d/ and prepares DNF for the selected Node.js stream.
Choose the setup script that matches your target major version:
setup_24.x: Node.js 24.14.x, the current Active LTS line (Krypton) and the safest choice for most new projectssetup_22.x: Node.js 22.22.x, the current Maintenance LTS line (Jod) for projects that are not ready to move to 24.xsetup_25.x: Node.js 25.8.x, the current short-support release for testing the newest upstream features
This example configures Node.js 24.x. Replace setup_24.x with setup_22.x or setup_25.x if your project needs a different stream:
curl -fsSL https://rpm.nodesource.com/setup_24.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
The -o nodesource_setup.sh flag saves the script to a local file so you can inspect or rerun it before executing it with sudo bash.
Confirm that the NodeSource repositories were added:
dnf repo list --enabled | grep nodesource
nodesource-nodejs Node.js Packages for Linux RPM based distros - x86_64 nodesource-nsolid N|Solid Packages for Linux RPM based distros - x86_64
Install Node.js from the newly added repository:
sudo dnf install nodejs -y
Verify the installed runtime and package source:
node --version
npm --version
rpm -q nodejs
v24.14.0 11.9.0 nodejs-24.14.0-1nodesource.x86_64
NodeSource updates through normal DNF upgrades. To switch major versions later, rerun the matching setup_22.x, setup_24.x, or setup_25.x script and then install nodejs again.
Install Node.js with NVM on Fedora
NVM installs Node.js into your home directory instead of Fedora’s system paths. That makes it the best choice when one project still needs Node.js 22 while another has already moved to 24 or 25.
Install the current NVM release and load it into your shell:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
source ~/.bashrc
Alternatively, open a new terminal window instead of reloading ~/.bashrc manually.
Zsh users should replace ~/.bashrc with ~/.zshrc. NVM is a shell function, not a binary, so verify it with command -v instead of which:
command -v nvm
nvm
For more on shell lookup behavior, the which command guide explains why command -v is the safer check here.
Install an LTS Release with NVM on Fedora
Install the latest LTS release directly, or request a specific major version if you already know the project target:
nvm install --lts
nvm install 24
Downloading and installing node v24.14.0... Downloading https://nodejs.org/dist/v24.14.0/node-v24.14.0-linux-x64.tar.xz... ######################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v24.14.0 (npm v11.9.0)
Confirm the active runtime and npm version:
node --version
npm --version
v24.14.0 11.9.0
Switch Between Node.js Versions with NVM on Fedora
Install another major, switch to it, and set your default version for future shells:
nvm install 22
nvm use 22
nvm alias default 24
nvm ls
Now using node v22.22.1 (npm v10.9.4)
-> v22.22.1 *
v24.14.0 *
system * (-> v22.22.0)
default -> 24 (-> v24.14.0 *)
node -> stable (-> v24.14.0 *) (default)
stable -> 24.14 (-> v24.14.0 *) (default)
lts/jod -> v22.22.1 *
lts/krypton -> v24.14.0 *
lts/* -> lts/krypton (-> v24.14.0 *)
This is a good point to install Git on Fedora for version control or install Yarn on Fedora if your projects prefer it over npm.
Update Node.js on Fedora
Use the update path that matches the method you installed. Mixing DNF, NodeSource, and NVM updates on the same runtime is how version drift starts.
Update DNF or NodeSource Node.js on Fedora
Fedora and NodeSource packages both update through DNF. If you stay on the same major line, a standard upgrade is enough:
sudo dnf upgrade --refresh -y
Verify the active runtime after the upgrade:
node --version
npm --version
# Fedora repository example v22.22.0 10.9.4 # NodeSource 24.x example v24.14.0 11.9.0
If you want a different NodeSource major version, rerun the matching setup_22.x, setup_24.x, or setup_25.x script first and then let DNF reinstall nodejs from the new repository stream.
Update NVM-Managed Node.js on Fedora
NVM updates by installing the target version, switching to it, and refreshing the default alias:
nvm install 24
nvm alias default 24
nvm use 24
Now using node v24.14.0 (npm v11.9.0) default -> 24 (-> v24.14.0 *)
Troubleshoot Node.js on Fedora
Most Fedora Node.js issues come from shell initialization, source mixing, or checking the wrong binary after you add NVM.
Fix “nvm: command not found” on Fedora
If the NVM install script completed but your next command fails like this:
bash: nvm: command not found
Your current shell has not loaded the NVM initialization lines yet. Reload the shell profile that the installer modified:
source ~/.bashrc
Zsh users should reload ~/.zshrc instead. Confirm that NVM is now available:
command -v nvm
nvm
Check Which Node.js Binary Fedora Is Using
If version output looks wrong after you test both DNF and NVM, check where the active node command is coming from:
command -v node
rpm -q nodejs
node --version
/usr/bin/node nodejs-22.22.0-2.fc43.x86_64 v22.22.0
If the first line points into ~/.nvm/versions/, an NVM-managed runtime is active in your shell. If it points to /usr/bin/node, you are using the Fedora or NodeSource package.
Fix Permission Denied During Global npm Install on Fedora
If global npm installs fail on a DNF or NodeSource setup, the current npm prefix is usually pointing at a root-owned system path.
npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules
Check the active prefix first:
npm config get prefix
/usr/local
If it points to a system directory, move global npm packages into a user-owned path and reload your shell:
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Alternatively, open a new terminal window after appending the PATH line.
Verify the new prefix:
npm config get prefix
/home/username/.npm-global
NVM avoids this problem by keeping npm packages under your home directory from the start.
Remove Node.js from Fedora
Use the removal steps that match the way you installed Node.js so package files, repos, and shell initialization do not linger.
Remove DNF or NodeSource Node.js from Fedora
Fedora and NodeSource both install the system runtime through the nodejs package name, so the package removal step is the same:
sudo dnf remove nodejs -y
Verify that the system packages are gone:
rpm -q nodejs nodejs-npm
package nodejs is not installed package nodejs-npm is not installed
If you used NodeSource, remove the repository files as well:
sudo rm -f /etc/yum.repos.d/nodesource*.repo
sudo dnf clean all
Remove NVM-Managed Node.js from Fedora
To remove one NVM-managed version, uninstall that major directly. To remove the whole NVM toolchain, delete the NVM directory, the npm cache it created in your home directory, and the shell init block that loads NVM.
The next commands permanently delete every Node.js version installed through NVM, along with npm packages stored under your NVM tree. If you want to keep one project runtime, uninstall individual versions first instead of removing the whole directory.
rm -rf ~/.nvm
rm -rf ~/.npm
Remove the NVM initialization lines from ~/.bashrc or ~/.zshrc. They look like this:
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
Reload the shell after you delete those lines:
source ~/.bashrc
Confirm that both NVM and Node.js are no longer available from your shell:
command -v nvm || echo "nvm not found"
node --version || echo "node not found"
nvm not found node not found
Node.js on Fedora FAQ
Fedora DNF is best when Node.js 22.x fits your project and you want distro-managed updates. NodeSource is better when you want a newer system-wide runtime such as 24.x LTS or 25.x Current. NVM is the better fit when different projects need different Node.js majors on the same Fedora user account.
Yes. Installing nodejs through Fedora DNF also pulls in Fedora’s nodejs-npm package automatically, so npm is available without a second install command. Verify both with node --version and npm --version after installation.
Yes. NVM keeps its runtimes under ~/.nvm, while Fedora and NodeSource install the system package under /usr/bin/node. That means both approaches can live on the same host, but your shell path decides which node command runs first.
Fedora 43 currently ships Node.js 22.22.x with npm 10.9.x in its standard repositories. That is the Maintenance LTS line, so Fedora’s package is still supported upstream, but it trails the newer 24.x Active LTS stream available from NodeSource and NVM.
Conclusion
Node.js is now running on Fedora from the package source that fits your workflow, with npm ready for package installs and version changes. Version-controlled projects pair naturally with install Git on Fedora. If you want to expand the JavaScript toolchain further, install Yarn on Fedora or install Docker on Fedora.
Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed:
<code>command</code>command<strong>bold</strong><em>italic</em><blockquote>quote</blockquote>