Can't start Node-RED on Raspberry

Hey, I just installed Node-RED on my Raspberry4. When I want to start it shows the error cause my boot system is not systemd

admin@raspberry:~ $ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.178.116:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
 
Starting as a systemd service.

What can I do to fix this?

This is what node-red -v shows:

6 Nov 19:36:12 - [info] 

Welcome to Node-RED
===================

6 Nov 19:36:12 - [info] Node-RED version: v2.1.3
6 Nov 19:36:12 - [info] Node.js  version: v14.18.1
6 Nov 19:36:12 - [info] Linux 5.10.63-v7l+ arm LE
6 Nov 19:36:13 - [info] Loading palette nodes
6 Nov 19:36:14 - [info] Settings file  : /home/admin/.node-red/settings.js
6 Nov 19:36:14 - [info] Context store  : 'default' [module=memory]
6 Nov 19:36:14 - [info] User directory : /home/admin/.node-red
6 Nov 19:36:14 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Nov 19:36:14 - [info] Flows file     : /home/admin/.node-red/flows.json
6 Nov 19:36:14 - [info] Creating new flow file
6 Nov 19:36:14 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

6 Nov 19:36:14 - [info] Server now running at http://127.0.0.1:1880/
6 Nov 19:36:14 - [info] Starting flows
6 Nov 19:36:14 - [info] Started flows

Just cd into .node-red folder and run node-red as a command

Same when I cd:

admin@raspberry:~/.node-red $ service node-red start
node-red: unrecognized service

It is this version:

admin@raspberry:~/.node-red $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
admin@raspberry:~/.node-red $ ps -p 1 -o comm=
init

If you used the node-red install script, you should be able to confirm that it works by running the command node-red.
That prints status messages up to "Started flows".

If that works type CTRL c and run sudo systemctl start nodered
(Note there is a hyphen in the first command, not in the second)

Then point a browser to your Pi IP address :1880 and you should see the editor.

Node-red will start up automatically when you reboot the Pi.

Yeah jbudd I uses the install script and node-red shows "Started Flows"

But sudo systemctl start nodered ends with a failure:

admin@raspberry:~ $ node-red
6 Nov 21:07:50 - [info] 

Welcome to Node-RED
===================

6 Nov 21:07:50 - [info] Node-RED version: v2.1.3
6 Nov 21:07:50 - [info] Node.js  version: v14.18.1
6 Nov 21:07:50 - [info] Linux 5.10.63-v7l+ arm LE
6 Nov 21:07:51 - [info] Loading palette nodes
6 Nov 21:07:52 - [info] Settings file  : /home/admin/.node-red/settings.js
6 Nov 21:07:52 - [info] Context store  : 'default' [module=memory]
6 Nov 21:07:52 - [info] User directory : /home/admin/.node-red
6 Nov 21:07:52 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Nov 21:07:52 - [info] Flows file     : /home/admin/.node-red/flows.json
6 Nov 21:07:52 - [info] Creating new flow file
6 Nov 21:07:52 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

6 Nov 21:07:53 - [info] Server now running at http://127.0.0.1:1880/
6 Nov 21:07:53 - [info] Starting flows
6 Nov 21:07:53 - [info] Started flows
^C6 Nov 21:08:28 - [info] Stopping flows
6 Nov 21:08:28 - [info] Stopped flows
admin@raspberry:~ $ sudo systemctl start nodered
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

This is the issue:

System has not been booted with systemd as init system (PID 1). Can't operate.

What operating system image are you running on the Pi? Is it the default Raspbian or something else?

It is the following:

admin@raspberry:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

What operating system is on the Pi? Raspberry Pi OS should have systemd

It is the following:

admin@raspberry:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Did you install RPIOS or some other version of Debian? I assume it's rpios

32 bit or 64?

Are you using docker?

Have you edited any files in /boot?

I suspect your raspberry pi os installation is broken, might be wise to start again, maybe on a new SD card

I'm not so confirm with raspberry so I used a pre configured image of Raspberry Pi OS. It runs a bridge to connect KNX to Apple HomeKit. All I know is that is using Pi OS and just changed username. No docker and I didn't change anything in /boot

You will have to ask the OS providers how to manage sevices in the absence of systemd.
Or else install the official version.

ps Changing the username is considered good security but I don't think it's for beginners. Just use a secure password.

It would of been good to tell us that in your first post...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.