step 1:Install Node-RED
Linux Installers for Node-RED
https://github.com/node-red/linux-installers#linux-installers-for-node-red
root@raspberrypi:~# bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
output
Running Node-RED install for user root at /root on raspbian
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED ✔
Remove old version of Node-RED ✔
Node option not specified : --node16, --node18 or --node20
Leave existing Node.js : v18.13.0 Npm 9.2.0
Clean npm cache -
Install Node-RED core
Move global nodes to local
Npm rebuild existing nodes
Install extra Pi nodes
Add shortcut commands
Update systemd script
Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880
Started : 2023年 10月 19日 星期四 01:45:03 CST
Finished: 2023年 10月 19日 星期四 01:54:09 CST
**********************************************************************************
### WARNING ###
DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST
Even if your Node-RED doesn't have anything valuable, (automated) attacks will
happen and could provide a foothold in your local network
Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
to setup security.
### ADDITIONAL RECOMMENDATIONS ###
- Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
when performing any sudo/root commands:
sudo rm -f /etc/sudoers.d/010_pi-nopasswd
- Do not run Node-RED as root or an administraive account
**********************************************************************************
root@raspberrypi:~#