Similar with golang, nodejs is available in Raspberry Pi OS distribution and you can install it with apt install nodejs, but at the time of writing this article, the latest version in distribution is 10.24.
Here I will show how to get latest stable version of nodejs for Raspberry Pi OS (armhf/arm32).
Requirements
- Rapsberry Pi 2/3/4
Get NodeJS
Go to nodejs download page. Find latest or prefered version of nodejs. Choose ARMv7 in Linux Binaries (ARM).
Install the Archive
- Extract nodejs archive with prefered app, in this case I use xarchiver
note : I install it in /usr/local/lib - Here I add following line to
$HOME/.profilefile. (again, it’s easier & simple 😛)# Nodejs VERSION=v14.16.0 DISTRO=linux-armv7l export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH - Next run
. ~/.profileor restart your Pi. Then check if nodejs is installed withnode -vcommand.
End
Thats all I can share now, next you can use nodejs to start coding or install/build software.
Good luck and thanks for reading. Don’t forget to share this article to your friends 😄