Setup a pi for node development
Updated May 26, 2024Created August 25, 2018
Raspberry pi's are awesome little pieces of hardware. I've developed an internet radio, a torrent video player, and a scrum board display all running on the low-power device.
One of the things I battled with was getting the device setup with node quickly to start development. Below is what I've found to work reliably.
Note: The Pi's SSH session will be represented with pi$
, and local machine with $
Install Raspbian
Download Raspbian Lite. I would always suggest downloading the latest version avalable. Instructions to flash the SD card are up on the RPI installing images page.
Enable SSH
Enable SSH on boot. Do this by placing a blank file saved with the name ssh
- no extension, on the SD card /boot
partition.
The SD /boot
partition should be accessible via your machines default file browser.
Alternatively you can do this via terminal: on a mac
Finally plug in the pi to your router, slip in the SD card, power it on.
SSH in
Either use Angry IP, or login to your home router (usually 192.168.0.1 or 192.168.1.1) and find the IP address of the pi.
You can also try using the pi device name raspberrypi
Open terminal and start up an SSH session, logging in as the default user pi, password raspberry.
We're in!
Raspi-config
Two important steps are to expand your pi's filesystem and change the password. This is done via raspi-config
Install Node
I always recommend using nvm - even more so with a raspberry pi as it can be a real pain.
Depending on the version of the ARM chipset, you'll need to find the appropriate nodejs binary, or compile it yourself. nvm handles all of this for you.
As per installation steps on the nvm website:
Install mplayer
This step is optional, but mplayer is a neat little terminal program allows us to stream internet radio.