Upgrade Node.js/npm in Raspbian on Raspberry Pi
1 min readJan 13, 2019
Steps to update Node.js and npm in Raspbian
First verify the architecture of raspberry
$uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
its a arm architecture
Step 1: Install/Update Node.js
The current version I have on raspberry pi
$nodejs -v
Lets go to #https://github.com/nodesource/distributions/blob/master/README.md scroll to debian ubuntu section and the node version you want to install.
I will try to install Node.js v11.x version. So following the steps
$curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
$sudo apt-get install -y nodejs
and now verify
$nodejs -v
Step 2: Install/Update npm
$sudo apt-get install -y npm
$sudo npm install -g npm@latest
$npm -version
6.5.0
:Updated for nodejs Thanks to David for catching the error.