The last notes
Website hosting
If you are choosing hosting for your project, I recommend Reg.ru. Modern infrastructure, a wide range of plans from starter options to high-load VPS, and responsive tech support that actually helps instead of sending template replies. I host some of my own projects there and recommend it to my clients.
Go to site Affiliate link. The price remains the same for you.All English-language materials have been translated fully automatically using the Google service
Fixing "Error installing package: nodejs" When Installing BitrixEnv 9 on CentOS Stream 9
You're deploying a Bitrix environment on a clean CentOS Stream 9, run the bitrix-env-9.sh installer, and hit a nodejs installation error. Environment setup aborts, the server remains unreachable from the Bitrix control panel, and you're facing an evening of manual debugging instead of working on the project.
Good news: the cause isn't hardware or the Bitrix build — it's a dnf module conflict. The error is typical, fixed in five minutes, and after that the installation goes through on the first try. Let's go step by step.
Why the Error Happens
In CentOS Stream 9, Node.js packages are managed through dnf modules from the AppStream repository. This means the same OS version can support several Node.js branches at once, and choosing a branch is a separate step, not a consequence of installing a package. The bitrix-env-9.sh script tries to install nodejs directly, but dnf blocks the installation because the required module isn't activated, and alternative sources (EPEL, NodeSource) conflict with AppStream.
In practice this looks like a chain of nothing provides... or conflict with... in the installation log. Setup aborts at the nodejs configuration step and doesn't proceed, because Push-server and part of Bitrix's frontend tooling simply won't start without it.
What this means for business: the server sits idle while the developer sorts out dnf, and if the error isn't fixed, you have to wipe the OS and start the installation over. Every such cycle is hours of downtime taken out of the launch timeline for a store or an internal project.
Step 1. Reset and Configure the Node.js dnf Module
Before re-running the installer, you need to clean the dnf cache and explicitly allow the OS to use the required Node.js branch. All commands run as root.
dnf clean all
dnf config-manager --set-disabled nodesource*
dnf module enable nodejs:22 -y
If the Bitrix installer requires a newer version, the branch can be switched to nodejs:22:
dnf config-manager --set-disabled nodesource*
dnf module enable nodejs:22 -y
To check which branch is currently active, use:
dnf module list nodejs --enabled
The output shows which stream is marked as enabled. If no stream is marked, nodejs will remain blocked at install time, and the Bitrix installer will fail at the same step again.
Step 2. Force-Install Node.js
Now you can install nodejs manually from the system repositories. This is needed so the Bitrix installer doesn't trip over the dependency and doesn't try to reach external sources that conflict with AppStream.
dnf install nodejs -y
Verify the installation succeeded and the version matches the chosen branch:
node --version
npm --version
Both commands should return a version number without errors. If node --version returns "command not found", dnf didn't install the binary — that's a signal that remnants of an old NodeSource or EPEL repository are still on the system, and they need to be removed before re-running the installer.
What this gives in practice: once nodejs is already installed, the Bitrix installer skips that step and moves on. This is exactly where BitrixEnv 9 installation on CentOS Stream 9 aborts in 90% of cases — fixing it takes minutes instead of hours of OS reinstallation.
Step 3. Re-run the Installer
Once you've confirmed nodejs and npm are installed, run the Bitrix installer again:
./bitrix-env-9.sh
The installer picks up the already installed nodejs, passes the configuration step, and continues the environment deployment. It then configures Nginx, PHP-FPM, MySQL, and Push-server exactly as it would on a clean system without dnf module conflicts.
What Else to Check After Installation
The BitrixEnv 9 installer deploys the environment, but two steps are easy to forget and later come back to bite when managing the server from the Bitrix panel.
sudo Rights for Management from the Bitrix Panel
After a successful installation, open /etc/sudoers.d/bitrix and uncomment all lines. By default some lines are commented out, and this causes access errors when creating sites, pools, and certificates through the web panel. The panel shows an error, the operation fails, and the logs show a standard permission denied.
You can verify the file applied correctly with:
visudo -c
The utility checks the syntax of all files in /etc/sudoers.d/ and shows errors if any exist. If after uncommenting visudo -c reports parsed OK, everything is fine.
Full System Update
Immediately after installation, run a full system update:
dnf update -y
This is required for correct integration of all environment services — Nginx, Push-server, and related PHP modules. Without the update, some services may fail to start after reboot, and you get "the site doesn't open" without a clear cause in the logs.
After the update, reboot the server and check that all services are up:
systemctl status nginx
systemctl status bitrix-push
Both services should be in the active (running) state. If one didn't start, look at journalctl -u nginx or journalctl -u bitrix-push — that's where the specific cause will be.
If the Error Persists: What's Needed for Diagnosis
In rare cases, the dnf module conflict isn't fully resolved by resetting nodejs. Then you need to look at the exact cause, not guess. The Bitrix installer writes a setup log to a file like /tmp/bitrix-env-*.log — the installer shows the path in the console before failing.
Three things will help with diagnosis:
- The exact error substring from the setup log — e.g.,
nothing provides...,conflict with..., orpackage X requires Y. That line alone tells you what's missing. - The specific
CentOSbuild:Stream,AlmaLinux, orRocky Linux.dnf modulebehavior may differ between them, and a fix forAlmaLinuxdoesn't always work onStream. - The list of enabled repositories — the
dnf repolistcommand. Ifnodesourceorepelappear in the list, that's an additional conflict source, and it's worth disabling during installation.
With these three items, the cause can be found in a couple of minutes instead of trying commands at random.
Comments