# Cannot start node-red after updating!

**URL:** https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200
**Category:** General
**Created:** [14 December 2022 15:37 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200 "2022-12-14T15:37:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Zorgo](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@Zorgo](https://discourse.nodered.org/u/Zorgo)
#### Post date: [14 December 2022 15:37 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/1 "2022-12-14T15:37:00Z")

</div>

After updating node-red 3.01 to 3.02 and NodeJS V14 to V16 can't start node-red any more.

nodered.service: Failed with result 'exit-code'

Please help with troubleshooting.

```auto
pi@raspberrypi:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.49: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

Starting as a systemd service.
14 Dec 15:17:48 - [info] Settings file : /home/pi/.node-red/settings.js
14 Dec 15:17:48 - [info] Context store : 'default' [module=memory]
14 Dec 15:17:48 - [info] User directory : /home/pi/.node-red
14 Dec 15:17:48 - [warn] Projects disabled : editorTheme.projects.enabled=false
14 Dec 15:17:48 - [info] Flows file : /home/pi/.node-red/flows.json
14 Dec 15:17:49 - [info] Server now running at http://127.0.0.1:1880/
14 Dec 15:17:49 - [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.
---------------------------------------------------------------------
14 Dec 15:17:49 - [info] Starting flows
CREDS { secretConfig: '{}' }
NEW DEVICE ID
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] Recieved the config {"id":"222db06ce97b147a","type":"tuya-smart-device","z":"d1b24b1396f6f4eb","deviceName":"AistesLED","disableAutoStart":false,"deviceId":"","deviceKey":"goem4r2by917fj1a","storeAsCreds":false,"deviceIp":"192.168.1.80","retryTimeout":1000,"findTimeout":10000,"tuyaVersion":"3.1","eventMode":"event-both","x":390,"y":880,"wires":[["dc4a6827eed0da01"],[]],"credentials":{"secretConfig":"{}"},"moduleVersion":"5.0.0"}
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] Event subscription : shouldSubscribeData=>true , shouldSubscribeRefreshData=>true
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] Auto start probe on connect...
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] closeComm(): Cleaning up the state
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] closeComm(): Clearing the find timeout handler
14 Dec 15:17:49 - [info] [tuya-smart-device:AistesLED] closeComm(): Disconnecting from Tuya Device
14 Dec 15:17:49 - [info] Started flows
14 Dec 15:17:49 - [red] Uncaught Exception:
14 Dec 15:17:49 - [error] InvalidCountryCodeError: Invalid ISO 3166-1 Alpha-2 country code
    at HTTPApi.setCountry (/home/pi/.node-red/node_modules/eufy-security-client/build/http/api.js:85:19)
    at new EufySecurity (/home/pi/.node-red/node_modules/eufy-security-client/build/eufysecurity.js:107:18)
    at EufySecurityNode.initialise (/home/pi/.node-red/node_modules/node-red-contrib-eufy-security/eufy-security/01-eufy-security.js:81:21)
    at new EufySecurityNode (/home/pi/.node-red/node_modules/node-red-contrib-eufy-security/eufy-security/01-eufy-security.js:66:14)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:90:27)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:206:48)
    at Object.start [as startFlows] (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:394:33)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Consumed 10.756s CPU time.
^C
pi@raspberrypi:~ $

```

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [14 December 2022 15:54 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/2 "2022-12-14T15:54:04Z")

</div>

> [@Zorgo](#):
>
> `node-red-contrib-eufy-security`

It would seem there is an error in this node you have loaded ???  
maybe you can start node-red manually using `node-red --safe` so they flows don't run, and you can edit the flow to fix or remove that node then redeploy.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [14 December 2022 15:56 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/3 "2022-12-14T15:56:35Z")

</div>

Welcome to the forum @`

How did you upgrade nodejs? If you did not use the Debian/Ubuntu/Pi upgrade script then after upgrading you should go into your .node-red folder and run  
`npm rebuild`  
If that doesn't fix it then make sure you are using the latest version of the node that is crashing node-red - node-red-contrib-eufy-security

Do you pass it a country code? If so then check that the one you are passing is valid. It may be, however, that the node is not compatible with nodejs 16.

---

<div class="post-metadata">

### Author: ![Zorgo](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@Zorgo](https://discourse.nodered.org/u/Zorgo)
#### Post date: [14 December 2022 16:09 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/4 "2022-12-14T16:09:54Z")

</div>

I start node-red manually using `node-red --safe` as you advised and deleted `node-red-contrib-eufy-security` flow and now it is working fine.  
Many thanks for your help.

---

<div class="post-metadata">

### Author: ![Zorgo](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@Zorgo](https://discourse.nodered.org/u/Zorgo)
#### Post date: [14 December 2022 16:15 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/5 "2022-12-14T16:15:19Z")

</div>

> [@Colin](#):
>
> Pi upgrade script

I did use Pi upgrade script from Node-red website. Looks like "node-red-contrib-eufy-security" caused the problem. After removing it, node-red working fine.  
Thanks

---

<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: [28 December 2022 16:16 UTC](https://discourse.nodered.org/t/cannot-start-node-red-after-updating/72200/6 "2022-12-28T16:16:01Z")

</div>

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