To begin the series about NodeJS on Raspberry PI (RPi), I will show you how to install and run the Hello world program with NodeJS on RPi

To install NodeJS on RPi, you only need 3 simple steps below:

Step 1: Prepare RPI 

To get startted, make sure your RPi is installed Raspian and config Internet.

Step 2: Run all commands in Terminal

wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-armv7l.tar.xz 
tar -xvf node-v4.3.2-linux-armv6l.tar.gz
cd node-v4.3.2-linux-armv6l
sudo cp -R * /usr/local/

Bước 3: Test and run “Hello world”

To test your installation and the version of NodeJS. Let’s run:

node -v

If you see v8.12.0, you’re success 😀 

To write the first program, you use node to start coding:

console.log("Hello world")

The “Hello world” message will be shown on your screen

At the next time, I give you the instruction of using  NPM – Node Package Manager to install some necessary libraries .

Phuong Duong – Mechasolution