
You installed Node.js on a VPS and the version is too old for your project, or you need to move up. The short answer: there are three routes, and the choice depends on how many projects you have and who runs them. For a server with one application, the NodeSource repository is the most direct. For several projects on different versions, nvm. The distribution’s package is the simplest, but it tends to be behind.
The three routes
| Method | Good for | The catch |
Distribution package (apt, dnf) |
Installing quickly, with the system’s security updates. | The version is often older than the one the project asks for. On AlmaLinux and Rocky the distribution offers module streams (dnf module list nodejs). |
| NodeSource repository | A recent, fixed version for the whole system; updates come through apt or dnf. |
Follow the command on their page, which changes with versions; do not copy it from an old tutorial. |
nvm (Node Version Manager) |
Several projects on different versions, or trying a new version without touching the old one. | It installs per user, not for the system. systemd and PM2 do not load nvm: use the full path to node. |
Choosing the version and confirming
|
|
|
|
Is the service still on the old Node? It is the commonest slip with nvm: your terminal uses the new version, but systemd (or PM2 started by another user) does not load nvm and runs whatever it finds. Put in ExecStart the full path that which node gave you with nvm active. See the service example with variables.
|
| Do not skip versions blindly. Go up one step at a time, test the application and only then move on. Before touching a server that hosts sites, make a backup: backing up a VPS. On an unmanaged VPS, Node and whatever runs on it are yours to maintain: how far our support goes. |
|
No VPS for your application yet? See the plans and pick the system when you order. See the VPS servers |
|
SEE ALSO Keeping a Node.js app running on a VPS with PM2 |
RECOMMENDED PRODUCT VPS server with root access Resources of your own, the OS you choose, reinstall whenever you like. from 7.560,00 Kz/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











