Update Node.js on Linux

node-js

Updated August 29, 2026

There is no single Linux-wide Node update command. Use the tool that installed your current version.

With nvm, install the latest LTS line and make it the default:

nvm install --lts
nvm alias default 'lts/*'
nvm use --lts
node --version

With a distribution package, update the package lists and upgrade the package through that distribution. On Ubuntu this is typically:

sudo apt update
sudo apt install --only-upgrade nodejs

The repository version may be older than the version required by a project. Check the project's .nvmrc, package.json engines, or CI configuration before changing it. Afterward run npm ci and the test/build commands; native dependencies may need rebuilding.

Avoid switching between nvm, a vendor repository, and a system package without checking command -v node. If the version did not change, the shell is probably selecting a different installation. Start a new shell or run the selected manager's documented initialization rather than editing system files.

Sources

related.

Ruslan Osipov

Ruslan Osipov

About the author