opkg update
opkg install node-npm
npm install -g --unsafe-perm node-red; npm install -g pm2
# Start Node-RED
pm2 start `which node-red` -- -v
# Save the service
pm2 save
# Create a service file
cat << EOF > /etc/init.d/pm2-root
#!/bin/sh /etc/rc.common
/usr/bin/pm2 start `which node-red` -- -v
EOF
# Make it executable
chmod +x /etc/init.d/pm2-root
# Enable the service
/etc/init.d/pm2-root enable