# node-RED won't start, Failed with result 'exit-code'

**URL:** <https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964>\
**Category:** General\
**Created:** [11 July 2022 17:08 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964 "2022-07-11T17:08:47Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2022 20:52 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/21 "2022-07-12T20:52:11Z")

</div>

Oh sorry, I removed it using a gui. `rm` removes files and folders but you need the `-r` option to remove a folder. The `f` does 'force'. Try using `rm -rf node-red-node-pi-neopixel`

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [12 July 2022 21:02 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/22 "2022-07-12T21:02:12Z")

</div>

> [@zenofmud](#):
>
> rm -rf node-red-node-pi-neopixel

The folder is deleted but node-red can't accomplish the startup sequence...

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [12 July 2022 21:17 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/23 "2022-07-12T21:17:41Z")

</div>

I'm making progress, I did the upgrade again (bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)), and then started with node-red test.flow -safe and now I see a lot of warnings and port 1880 is apparently already used?

```auto
pi@Rpi4:~/.node-red $ node-red test.flow -safe
12 Jul 23:12:12 - [info]

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

12 Jul 23:12:12 - [info] Node-RED version: v2.2.2
12 Jul 23:12:12 - [info] Node.js version: v12.22.12
12 Jul 23:12:12 - [info] Linux 5.10.103-v7l+ arm LE
12 Jul 23:12:12 - [info] Loading palette nodes
12 Jul 23:12:18 - [info] Worldmap version 2.13.2
12 Jul 23:12:19 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
12 Jul 23:12:20 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
12 Jul 23:12:20 - [warn] ------------------------------------------------------
12 Jul 23:12:20 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
12 Jul 23:12:20 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
12 Jul 23:12:20 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
12 Jul 23:12:20 - [warn] ------------------------------------------------------
12 Jul 23:12:20 - [warn] Missing node modules:
12 Jul 23:12:20 - [warn] - node-red-contrib-actionflows (2.0.4): actionflows, actionflows_in, actionflows_out
12 Jul 23:12:20 - [warn] - node-red-contrib-binary (0.1.3): binary
12 Jul 23:12:20 - [warn] - node-red-contrib-covid19 (1.1.0): COVID-19
12 Jul 23:12:20 - [warn] - node-red-contrib-date-converter (0.0.3): date-converter
12 Jul 23:12:20 - [warn] - node-red-contrib-dht-sensor (1.0.4): rpi-dht22
12 Jul 23:12:20 - [warn] - node-red-contrib-ds18b20-sensor (1.3.6): rpi-ds18b20
12 Jul 23:12:20 - [warn] - node-red-contrib-gpio (0.14.0): gpio in, gpio out, node-led, nodebot, johnny5
12 Jul 23:12:20 - [warn] - node-red-contrib-image-output (0.6.3): image
12 Jul 23:12:20 - [warn] - node-red-contrib-loop-processing (0.3.1): counter-loop, array-loop, while-loop
12 Jul 23:12:20 - [warn] - node-red-contrib-lora-data-decrypt (0.0.1): lora-decrypt
12 Jul 23:12:20 - [warn] - node-red-contrib-lorawan (0.0.4): lorawan-rx, lorawan-tx, lorawan-config
12 Jul 23:12:20 - [warn] - node-red-contrib-luftkvalitet (0.0.5): luftkvalitet-latest, luftkvalitet-historical, luftkvalitet-daily, luftkvalitet-lookup
12 Jul 23:12:20 - [warn] - node-red-contrib-message-counter (1.0.1): Message Counter
12 Jul 23:12:20 - [warn] - node-red-contrib-mqtt-broker (0.2.9): mosca in
12 Jul 23:12:20 - [warn] - node-red-contrib-openaq (0.0.5): openaq-cities, openaq-countries, openaq-fetches, openaq-latest, openaq-locations, openaq-measurements, openaq-parameters, openaq-sources
12 Jul 23:12:20 - [warn] - node-red-contrib-play-audio-file (0.0.1): play_audio_file
12 Jul 23:12:20 - [warn] - node-red-contrib-python-function (0.0.4): python-function
12 Jul 23:12:20 - [warn] - node-red-contrib-rfxcom (2.9.1): rfxtrx-port, rfx-lights-in, rfx-lights-out, rfx-blinds-in, rfx-blinds-out, rfx-doorbell-in, rfx-doorbell-out, rfx-meter, rfx-sensor, rfx-trv-out, rfx-heat-out, rfx-detector-in, rfx-alarm-out, PT2262-device-list, rfx-PT2262-in, rfx-PT2262-out
12 Jul 23:12:20 - [warn] - node-red-contrib-termux-api (0.0.5): termux-battery-status, termux-camera-info, termux-clipboard-get, termux-contact-list, termux-telephony-cellinfo, termux-telephony-deviceinfo, termux-tts-engines, termux-camera-photo, termux-clipboard-set, termux-dialog, termux-download, termux-location, termux-tts-speak, termux-vibrate, termux-sms-inbox, termux-toast, termux-sms-send, termux-share, termux-notification, termux-wifi-connectioninfo, termux-wifi-scaninfo
12 Jul 23:12:20 - [warn] - node-red-contrib-timed-counter (0.0.4): timed-counter
12 Jul 23:12:20 - [warn] - node-red-contrib-tuya (0.1.0): tuya
12 Jul 23:12:20 - [warn] - node-red-contrib-tuya-smart (1.2.0): tuya-smart
12 Jul 23:12:20 - [warn] - node-red-contrib-unificationengine (0.0.18): unificationengine, google-credentials, google-api-config, linkedin-credentials, linkedin-api-config, facebook-credentials, facebook-api-config, twitternode-credentials, twitternode-api-config, weibo-credentials, weibo-api-config, sms-credentials, sms-api-config, whatsapp-credentials, whatsapp-api-config, smtp-credentials, smtp-api-config, telegram-credentials, telegram-api-config, viberpa-credentials, viberpa-api-config, kik-credentials, kik-api-config, line-credentials, line-api-config, sendgrid-credentials, sendgrid-api-config, threema-credentials, threema-api-config, fbmessenger-credentials, fbmessenger-api-config, skype-credentials, skype-api-config, kakaostory-credentials, kakaostory-api-config, fbworkplace-credentials, fbworkplace-api-config, viber-credentials, viber-api-config, tumblr-credentials, tumblr-api-config, wechat-credentials, wechat-api-config
12 Jul 23:12:20 - [warn] - node-red-contrib-viseo-ms-authentication (0.0.2): ms-luis-config, ms-config
12 Jul 23:12:20 - [warn] - node-red-contrib-viseo-ms-speech (0.2.0): ms-speech-text
12 Jul 23:12:20 - [warn] - node-red-contrib-weekday (0.1.0): weekday
12 Jul 23:12:20 - [warn] - node-red-contrib-youtube (0.0.10): google-credentials-youtube, youtube-download, youtube-upload
12 Jul 23:12:20 - [warn] - node-red-node-arduino (0.3.1): arduino in, arduino out, arduino-board
12 Jul 23:12:20 - [warn] - node-red-node-openweathermap (0.2.2): openweathermap, openweathermap in
12 Jul 23:12:20 - [warn] - node-red-node-pi-gpiod (0.0.13): pi-gpiod in, pi-gpiod out
12 Jul 23:12:20 - [warn] - node-red-node-pi-sense-hat (0.0.18): rpi-sensehat in, rpi-sensehat out
12 Jul 23:12:20 - [warn] - node-red-node-youtube (0.0.5): google-config, YouTube PlayListItems, YouTube PlayLists, YouTube Channels
12 Jul 23:12:20 - [warn] - sense-neuralnetwork (1.0.2): neural-network, reinforced-agent
12 Jul 23:12:20 - [info] Removing modules from config
12 Jul 23:12:20 - [info] Settings file : /home/pi/.node-red/settings.js
12 Jul 23:12:20 - [info] HTTP Static : /home/pi/node-red-static
12 Jul 23:12:20 - [info] Context store : 'default' [module=memory]
12 Jul 23:12:20 - [info] User directory : /home/pi/.node-red
12 Jul 23:12:20 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jul 23:12:20 - [info] Flows file : /home/pi/.node-red/test.flow
12 Jul 23:12:20 - [info] Creating new flow file
12 Jul 23:12:20 - [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.
---------------------------------------------------------------------

12 Jul 23:12:20 - [error] Unable to listen on http://127.0.0.1:1880/
12 Jul 23:12:20 - [error] Error: port in use

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2022 21:38 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/24 "2022-07-12T21:38:47Z")

</div>

> [@maru](#):
>
> now I see a lot of warnings and port 1880 is apparently already used?

That means that Node-RED is already running. You probably ran `sudo systemctl enable nodered.service` at some point and that causes Node-RED to autostart at boot.

You should be good now, have you tried to get into the editor?

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [12 July 2022 21:39 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/25 "2022-07-12T21:39:21Z")

</div>

After a shutdown and removing the power supply, the Port in use message has disappeared.  
With the command node-red test.flow -safe starts node-RED and I can get to the GUI.

When I want node-RED to load my flows, I still get the startup loop:

```auto
Welcome to Node-RED
===================
12 Jul 23:32:59 - [info] Node-RED version: v2.2.2
12 Jul 23:32:59 - [info] Node.js version: v12.22.12
12 Jul 23:32:59 - [info] Linux 5.10.103-v7l+ arm LE
12 Jul 23:32:59 - [info] Loading palette nodes
12 Jul 23:33:05 - [info] Worldmap version 2.13.2
12 Jul 23:33:06 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
12 Jul 23:33:06 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
12 Jul 23:33:07 - [warn] ------------------------------------------------------
12 Jul 23:33:07 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
12 Jul 23:33:07 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
12 Jul 23:33:07 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
12 Jul 23:33:07 - [warn] ------------------------------------------------------
12 Jul 23:33:07 - [info] Settings file : /home/pi/.node-red/settings.js
12 Jul 23:33:07 - [info] HTTP Static : /home/pi/node-red-static
12 Jul 23:33:07 - [info] Context store : 'default' [module=memory]
12 Jul 23:33:07 - [info] User directory : /home/pi/.node-red
12 Jul 23:33:07 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jul 23:33:07 - [warn] Flows file name not set. Generating name using hostname.
12 Jul 23:33:07 - [info] Flows file : /home/pi/.node-red/flows_Rpi4.json
12 Jul 23:33:07 - [error] Unable to listen on http://127.0.0.1:1880/
12 Jul 23:33:07 - [error] Error: port in use
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=100ms expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 7.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
12 Jul 23:33:09 - [info]
Welcome to Node-RED
===================
12 Jul 23:33:09 - [info] Node-RED version: v2.2.2 **strong text**

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2022 22:02 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/26 "2022-07-12T22:02:03Z")

</div>

> 12 Jul 23:33:07 - [error] Unable to listen on [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
> 12 Jul 23:33:07 - [error] Error: port in use

It didn't start because it's already running.

Do this, run `node-red-stop`  
then run `sudo systemctl disable nodered.service`  
then run `node-red flows_Rpi4.json --safe` ?  
and what does the log show.

You also might want to read the documentation at [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [13 July 2022 08:59 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/27 "2022-07-13T08:59:04Z")

</div>

Okay, here is my output:

```auto
pi@Rpi4:~/.node-red $ node-red flows_Rpi4.json --safe
13 Jul 10:36:52 - [info]

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

13 Jul 10:36:52 - [info] Node-RED version: v2.2.2
13 Jul 10:36:52 - [info] Node.js version: v12.22.12
13 Jul 10:36:52 - [info] Linux 5.10.103-v7l+ arm LE
13 Jul 10:36:53 - [info] Loading palette nodes
13 Jul 10:37:06 - [info] Worldmap version 2.13.2
13 Jul 10:37:09 - [info] Dashboard version 2.28.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
13 Jul 10:37:09 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
13 Jul 10:37:11 - [warn] ------------------------------------------------------
13 Jul 10:37:11 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red
13 Jul 10:37:11 - [warn] [node-red-contrib-google-translate-fixed/google-translate] 'google-translate' already registered by module node-red-contrib-google-translate
13 Jul 10:37:11 - [warn] [node-red-node-group/group] Error: This module is not required for Node-RED 1.1.0 or later (line:9)
13 Jul 10:37:11 - [warn] ------------------------------------------------------
13 Jul 10:37:11 - [info] Settings file : /home/pi/.node-red/settings.js
13 Jul 10:37:11 - [info] HTTP Static : /home/pi/node-red-static
13 Jul 10:37:11 - [info] Context store : 'default' [module=memory]
13 Jul 10:37:11 - [info] User directory : /home/pi/.node-red
13 Jul 10:37:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Jul 10:37:11 - [info] Flows file : /home/pi/.node-red/flows_Rpi4.json
13 Jul 10:37:12 - [info] Server now running at http://127.0.0.1:1880/
13 Jul 10:37:12 - [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.
---------------------------------------------------------------------

13 Jul 10:37:12 - [info] *****************************************************************
13 Jul 10:37:12 - [info] Flows stopped in safe mode. Deploy to start.
13 Jul 10:37:12 - [info] *****************************************************************

```

The server starts but the dashboard is **not** available  
I can now see my tabs with flows.  
What is the recommended next step?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 09:02 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/28 "2022-07-13T09:02:00Z")

</div>

Try a deploy, stop NR and start it again and see what the log looks like.

---

<div class="post-metadata">

**Author:** ![maru](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maru/32/99601_2.png) [@maru](https://discourse.nodered.org/u/maru)\
**Post date:** [13 July 2022 10:11 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/29 "2022-07-13T10:11:59Z")

</div>

That's it Paul!

I can deploy a flow, restarted node-red and now the Dashboard is available.  
I will clean up several Tabs/flows and try to eliminate the node-red startup warnings.

Thank you for spending your time 👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 September 2022 10:12 UTC](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964/30 "2022-09-11T10:12:39Z")

</div>

Closed on 11 September 2022 10:12 UTC

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

[Previous page](https://discourse.nodered.org/t/node-red-wont-start-failed-with-result-exit-code/64964.md?page=1)
