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
Removing node from Raspberry Pi
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.
Removing Nodejs from the Raspberry Pi
Awesome! Now let's reinstall Nodejs using the command:
sudo apt install nodejs
Installing Nodejs to our Raspberry Pi
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
The newest versions of Nodejs & npm installed on my Raspberry Pi.
We have successfully installed the latest Nodejs and npm versions to our Raspberry Pi 4! Congratulations! 🎉
No comments:
Post a Comment