In this tutorial we will check how to get started using Node.js on the Rasperry Pi 3. We will develop a very simple “hello world” application.
The Node.js version used was 12.2.0. This version is more recent than the one that originally comes installed with Raspbian. Nonetheless, this tutorial should also work for older versions. If you want to update your Node.js version, please follow this guide.
The first thing we will do is opening a command line. Once you do it, simply type the following command and press Enter:
This should open the Node.js interpreter, where we can send commands. Figure 1 illustrates the expected result after sending the previous command.
After this, for printing a “hello world” message, simply write the following command and hit Enter:
You should get a result similar to figure 2. As can be sen, the “Hello World” message gets printed to the console, as expected.