Update Node.js and Node-Red on the Enterprise Gateways

SSH Access

You will need SSH access to your Enterprise Gateway in order to follow along with this document. If you aren’t sure how to do this you can use this document to make sure the correct settings are enabled: SSH into your IoT Enterprise Gateway.

Default SSH Credentials:
Username: ncdio
Password: ncdB3ast

Windows users can use Powershell or a terminal program like PuTTy while Mac and Linux users can use the default terminal.

Instructions

  1. Use the node-red interface to Export and Download “all flows”
  2. SSH into your Enterprise Gateway
  3. Paste this command into the terminal:
    • bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) –node20
    • Note: When prompted to install Raspberry Pi nodes, select ‘No’
  4. Wait for the installation to finish
  5. Check the node version installed using this command:
    • node -v
  6. Restart node-red using this command:
    • pm2 restart all

Troubleshooting

If you receive error messages when opening Node-Red after an update use the following commands:

cd ~/.node-red
npm rebuild
npm install
npm rebuild
pm2 restart all

If you are still getting errors in node-red after that you can try to completely uninstall and reinstall the node-red-enterprise-sensors library. This library requires compiling so any update to Node.js may need to be cleared and recompiled from scratch.

cd ~/.node-red
npm uninstall @ncd-io/node-red-enterprise-sensors
rm -rf ~/.node-red/node_modules/@ncd-io
npm install @ncd-io/node-red-enterprise-sensors