I want to automatically start nodered on boot. I'm using a raspberry 3 model B v2.
According to those instructions "https://nodered.org/docs/getting-started/raspberrypi" , I have install and create a flow.
I'm using Node-RED version: v0.20.7 Node.js version: v8.16.0
When I start nodered using node-red-pi --max-old-space-size=256
it's working perfectly.
But now I want to use it as a service and launch it automatically.
Following the same instructions, I ran the command sudo systemctl enable nodered.service. The reboot, and nothing happened. Nodered didn't start.
I tried to run it directly as a service using node-red-start, and I got this error message
Starting as a systemd service.
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool...
Starting Node-RED graphical event wiring tool...
Started Node-RED graphical event wiring tool.
/usr/bin/env: node-red-pi: No such file or directory
nodered.service: main process exited, code=exited, status=127/n/a
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool...
Starting Node-RED graphical event wiring tool...
Started Node-RED graphical event wiring tool.
/usr/bin/env: node-red-pi: No such file or directory
nodered.service: main process exited, code=exited, status=127/n/a
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool...
Starting Node-RED graphical event wiring tool...
Started Node-RED graphical event wiring tool.
/usr/bin/env: node-red-pi: No such file or directory
nodered.service: main process exited, code=exited, status=127/n/a
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool...
Starting Node-RED graphical event wiring tool...
Started Node-RED graphical event wiring tool.
/usr/bin/env: node-red-pi: No such file or directory
nodered.service: main process exited, code=exited, status=127/n/a
Unit
nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool...
Starting Node-RED graphical event wiring tool...
nodered.service start request repeated too quickly, refusing to start.
Failed to start Node-RED graphical event wiring tool.
Unit nodered.service entered failed state.
Has someone an idea about this error and how to fix it? There is another way to start nodered automatically?
/usr/bin/env: node-red-pisuggests node-red hasn't installed properly. Try rerunning theupdate-nodejs-and-noderedscript from the documentation. If it still fails, come talk to us on the forum where we can debug it better. SO isn't the best place to debug an issue of this nature. - knolleary