综合编程

Raspberry Pi 3: Node.js Hello world

微信扫一扫,分享到朋友圈

Raspberry Pi 3: Node.js Hello world
0

In this tutorial we will check how to get started using Node.js on the Rasperry pi. We will develop a very simple “hello world” application. This tutorial was tested on a Raspberry Pi 3 model B+ .

Introduction

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.

This tutorial was tested on a Raspberry Pi 3 model B+ , running  version 4.9 of Raspbian, installed using  NOOBS .

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 procedure

The first thing we will do is opening a command line. Once you do it, simply type the following command and press Enter:

node

This should open the Node.js interpreter, where we can send commands. Figure 1 illustrates the expected result after sending the previous command.

Figure 1 – The Node.js interpreter.

After this, for printing a “hello world” message, simply write the following command and hit Enter:

console.log("Hello world")

You should get a result similar to figure 2. As can be sen, the “Hello World” message gets printed to the console, as expected.

Figure 2 – Printing a “Hello World” message with Node.js.

阅读原文...


微信扫一扫,分享到朋友圈

Raspberry Pi 3: Node.js Hello world
0

techtutorialsx

React Starter: Adding Sass to Create React App Applications

上一篇

Implementing infinite loading in an Angular store application

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

Raspberry Pi 3: Node.js Hello world

长按储存图像,分享给朋友