Setting Up Node-RED
To begin, create a directory called nodered to house your Node-RED-based code. Then open a terminal to this directory and create an initial package.json.
â | â$ âânpmââ ââinitââ ââ-yâ |
Next, install the node-red package locally.
â | â$ âânpmââ ââinstallââ ââ--saveââ ââ--save-exactââ âânode-red@0.16.2â |
Then open your package.json in a text editor and add a start script to the scripts section like so:
â | â"scripts"â: { |
» | â"start"â: â"node-red -v -u ./config -f ./config/flows.json"â, |
â | â"test"â: â"echo ââ\"ââError: no test specifiedââ\"ââ && exit 1"â |
â | }, |
Here weâre specifying a couple of command-line arguments to the ...
Get Node.js 8 the Right Way 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.