Setting up Node.js

Assuming that this is the same Raspberry Pi 3 that was used in Chapter 3, Getting Started with IoT Platforms, it should have Node.js installed. If Node.js is not installed, please refer to the following steps:

  1. Open a new Terminal and run the following commands:
$ sudo apt update
$ sudo apt full-upgrade  
  1. This will upgrade all the packages that need upgrades. Next, we will install the latest version of Node.js. We will be using the Node 7.x version:
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
$ sudo apt install nodejs  
  1. This will take a moment to install, and once your installation is done, you should be able to see the version of Node.js and NPM after running the following commands:
$ node -v$ npm ...

Get Enterprise Internet of Things Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.