🔥 Save unlimited web pages along with a full PDF snapshot of each page. Unlock Premium →
In this tutorial, we will update Nodejs & npm on our Raspberry Pi 4.
Procedure:
To begin, please open the terminal on your Raspberry Pi.
We will get the latest system's package list onto the Raspberry Pi by using the following command:
sudo apt update
Next, please install the latest packages available to the Raspberry Pi using:
sudo apt full-upgrade
Now, let's check the version of Nodejs and npm by typing the following command:
node -v npm -v
You will notice that my Nodejs version is v10.19.0, which is decent… but I want to update it to the most current version, which is 14.3.0.
Also, my npm version is 5.8.0, which is out of date. We will want to get the newest version, v6.14.5.
To obtain the newest versions of both Nodejs and npm, we have to first remove and then reinstall their packages to ensure we obtain the latest releases.
Please run the following commands in the terminal command-line:
sudo apt remove node
It looks like I did not have node installed.
Now, let us proceed to the next step by entering the folloing:
sudo apt remove nodejs
To remove Nodejs, you will be prompted to validate your request so make sure to proceed with a command. Type in Y (Yes) in the command-line to continue to remove Nodejs.
Awesome! Now let's reinstall Nodejs using the command:
sudo apt install nodejs
Perfect! Once those commands have taken effect we will check to see if we obtained the latest versions.
Now, please run the following command:
nodejs -v node -v npm -v
We have successfully installed the latest Nodejs and npm versions to our Raspberry Pi 4! Congratulations! 🎉
No comments:
Post a Comment