Upgrading the Node JS version is not working in the Raspiberry Pi 4 with Raspbian

Viewed 940

I am trying to upgrade the NodeJS version my Raspberry Pi model 4 with Raspbian OS installed. I am an absolute beginner to the Raspiberry PI. I followed this article to upgrade the Node version, https://medium.com/@thedyslexiccoder/how-to-update-nodejs-npm-on-a-raspberry-pi-4-da75cad4148c. So I run the following commands in the terminal.

sudo apt update
sudo apt full-upgrade
sudo apt remove node
sudo apt remove nodejs
sudo apt install nodejs

When I checked the node version, it is still 10. It is not updated. What is wrong and how can I fix it?

1 Answers

Nodejs versions are in their own apt repositories, one per version.

You need to do something like this.

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Read the referenced page for more details.

Related