
The problem with using Ubuntu provided Node.js is that it gets outdated (not insecure) over time. Method 2: Install and update the latest Node.js from official repositories If there are any upgrades, you will be able to install them just like any other normal software package. To do that, use the following command: sudo apt-get install -only-upgrade nodejs So, the easiest way to upgrade Node.js to a newer version is to install it from the official repositories. The maintainers have gone through the effort of making all software compatible with each other, removing most dependency issues. The recommended method to upgrade and install any software on your Linux distribution is to use the first-party repositories. Method 1: Upgrade from Ubuntu's repositories I have version 12.22.9 installed (v12.x).Īt the time of writing this, v18.x and v16.x are the latest and LTS versions, respectively. This is what it looks like on my computer: $ node -v

To check the version of Node.js, run the following command: node -v Check Node.js versionīefore you actually upgrade Node.js, do check if the currently installed version is what you want or it is outdated.
Update nodejs how to#
To know how to do that, continue reading. There are other ways to upgrade Node.js manually. Do so with the following command: sudo apt-get install -only-upgrade nodejs The easiest way to upgrade Node.js is using the apt package manager. Node.js is an open source JavaScript runtime environment.
