And this is the installation script we use:
set -e
# don't ask question
export DEBIAN_FRONTEND=noninteractive
# gnupg for apt-key
# g++ for the node-red NPM package
echo "installation of dependenicies"
apt install -y --no-install-recommends wget curl gnupg g++ make
# add unofficial NodeJS repository and install the nodejs
# https://github.com/nodesource/distributions/blob/master/README.md#debmanual
echo "Installation of nodejs and npm"
wget -O - -q https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
echo "deb https://deb.nodesource.com/node_12.x buster main" > /etc/apt/sources.list.d/nodesource.list
apt update
apt install -y --no-install-recommends nodejs
# installation of npm
curl https://www.npmjs.com/install.sh | bash
# Node-RED installation
echo "Installation of node-red via npm"
npm install -g --unsafe-perm node-red
# install the Node-RED systemd service
echo "Setting up the Node-RED to be run via systemd"
cp "${SCRIPT_FILES}/node-red.service" /etc/systemd/system
systemctl enable node-red