Some of the nodes also have dependencies on external libraries and without these being installed will not function correctly. As an example for the twitter node to work correctly you need OAuth which allows you to authenticate with twitter.com to be able to send/receive tweets.
You may remember from the initial starting of node red we saw a list of these missing dependencies as shown below.
25 Jan 11:31:45 - [red] Loading palette nodes 25 Jan 11:31:45 - ------------------------------------------ 25 Jan 11:31:54 - [61-email.js] Error: Cannot find module '/home/pi/node-red/../emailkeys.js' 25 Jan 11:31:54 - [imap] : Failed to load Email credentials 25 Jan 11:31:55 - [66-mongodb.js] Error: Cannot find module 'mongodb' 25 Jan 11:31:57 - [74-swearfilter.js] Error: Cannot find module 'badwords' 25 Jan 11:31:57 - [72-wordpos.js] Error: Cannot find module 'wordpos' 25 Jan 11:31:57 - [78-ledborg.js] Warning: PiBorg hardware : LedBorg not found 25 Jan 11:31:57 - [76-blinkstick.js] Error: Cannot find module 'blinkstick' 25 Jan 11:31:57 - [77-blink1.js] Error: Cannot find module 'node-blink1' 25 Jan 11:31:57 - [78-digiRGB.js] Error: Cannot find module 'node-hid' 25 Jan 11:31:57 - [103-hue_discover.js] Error: Cannot find module 'node-hue-api' 25 Jan 11:31:57 - [104-hue_manage.js] Error: Cannot find module 'node-hue-api' 25 Jan 11:31:57 - [103-hue_discover.js] Error: Cannot find module 'node-hue-api' 25 Jan 11:31:58 - [104-hue_manage.js] Error: Cannot find module 'node-hue-api' 25 Jan 11:31:58 - [101-scanBLE.js] Error: Cannot find module 'noble' 25 Jan 11:31:58 - [79-sensorTag.js] Error: Cannot find module 'sensortag' 25 Jan 11:31:58 - [60-wemo.js] Error: Cannot find module 'wemo' 25 Jan 11:31:58 - [26-rawserial.js] Advise: Only really needed for Windows boxes without serialport npm module installed. 25 Jan 11:31:58 - [39-wol.js] Error: Cannot find module 'wake_on_lan' 25 Jan 11:31:58 - [69-mpd.js] Error: Cannot find module 'komponist' 25 Jan 11:31:58 - [57-notify.js] Error: Cannot find module 'growl' 25 Jan 11:31:58 - [57-prowl.js] Error: Cannot find module 'node-prowl' 25 Jan 11:31:58 - [57-pushbullet.js] Error: Cannot find module 'pushbullet' 25 Jan 11:32:00 - [56-twilio.js] Error: Failed to load Twilio credentials 25 Jan 11:32:00 - [92-xmpp.js] Error: Cannot find module 'simple-xmpp'
Luckily it is very easy to install these and as an example if we wanted to install the swear filter node, which filters out bad words we just simply have to carry out the following steps.
First stop node red if it is running using the management script from earlier on in the tutorial.
sudo service node_red stop
cd ~/node-red/
sudo npm install badwords
npm http GET https://registry.npmjs.org/badwords npm http 200 https://registry.npmjs.org/badwords npm http GET https://registry.npmjs.org/badwords/-/badwords-0.0.3.tgz npm http 200 https://registry.npmjs.org/badwords/-/badwords-0.0.3.tgz [email protected] node_modules/badwords
sudo service node_red start
Simply stop Node-Red and follow the process as we did for the bad words example but replace sudo npm install badwords with the following line.
sudo npm install ntwitter oauth sentiment wordpos xml2js firmata fs.notify serialport feedparser pushbullet irc simple-xmpp redis mongodb