

Option 2 (the “lazy” option) : As a second option if you are not sure if you are already running the latest version of Node, you can simply power through and proceed with sudo apt install (listed next).In this case, we see that Node 18.16.0 is available so we want to continue and upgrade. You could optionally add the -a switch ( apt list -a nodejs) to review additional versions of nodejs available however, the basic apt list command will show the most recent version of Node available. Nodejs/unknown 18.16.0-1nodesource1 armhf This command will provide output that looks something like this: Listing. Option 1 (the “diligent” option): Issue the following command to determine the latest version that is available in the package repository:.If you are not sure if you are already running the latest version of Node available, you have two options: Please see my Debian apt command cheat sheet for more information. Note: we are using the newer Debian apt command as opposed to the older apt-get command. Issue the following command at the “$” prompt: $ sudo apt update This command will not actually update any software on the system, but will download the latest package lists from the software repositories so that Raspbian will be aware of all new software available along with dependencies. I see that I am running Node 18.3.0 and I really want to be running the latest stable build within this Node branch (Node 18.16.0).įirst, we run the apt “update” command. Run the following command from the terminal: $ node -v Our first step is to ascertain the current version of Node we are running. For example, upgrading from Node 18.3.0 to Node 18.16.0.

This section explains the steps necessary to upgrade Node to the latest version within a given major version. Let’s get started! Minor/Patch Version Upgrades

I’m assuming you followed the steps in my Beginners’ Guide, especially under the “Install Node.js” section where we update the Raspbian/Debian package repository to include the Node.js binaries provided by NodeSource. The steps are quite easy and can be adapted to other Debian variants as well including Ubuntu. I’ve received questions from readers of my Beginner’s Guide to Installing Node.js on a Raspberry Pi wanting to know how to upgrade to more recent versions of Node.js on the Raspberry Pi.
