# ERROR starting node red

**URL:** <https://discourse.nodered.org/t/error-starting-node-red/72350>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [17 December 2022 12:11 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350 "2022-12-17T12:11:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [17 December 2022 12:11 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/1 "2022-12-17T12:11:43Z")

</div>

17 Dec 17:38:15 - [info] Node-RED version: v3.0.2  
17 Dec 17:38:15 - [info] Node.js version: v18.12.1  
17 Dec 17:38:15 - [info] Windows\_NT 10.0.19044 x64 LE  
17 Dec 17:38:17 - [info] Loading palette nodes  
17 Dec 17:38:17 - [error] Failed to start server:  
17 Dec 17:38:17 - [error] TypeError: Cannot read properties of undefined (reading 'forEach')  
at Object.addModule (C:\Users\myname\AppData\Roaming\npm\node\_modules\node-red\node\_modules@node-red\registry\lib\registry.js:195:27)  
at C:\Users\myname\AppData\Roaming\npm\node\_modules\node-red\node\_modules@node-red\registry\lib\loader.js:153:34

---

<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:** [17 December 2022 14:29 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/2 "2022-12-17T14:29:03Z")

</div>

What have you just done that may have triggered that? Perhaps you have just installed a new node-type.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [17 December 2022 14:58 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/3 "2022-12-17T14:58:18Z")

</div>

I downloaded a working flow from one pc to a new Pc with a new installation of node red running on it. So the database node was flaged in red because such a database did not exist in the new PC. I created the database named readings in mysql and when I tried to edit the properties in the database node the node red server lost its connectivity and after that I could not restart node red or even edit what was on  
screen.

---

<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:** [17 December 2022 15:06 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/4 "2022-12-17T15:06:31Z")

</div>

Which database node are you using? The error you posted is caused by a badly behaved node that is not compatible with the latest node-red.

Did you re-install all the extra nodes manually, or did you copy the folder .node-red/node\_modules across from the old one? If you copied node\_modules then delete that folder and go into your .node-red folder and run  
`npm install`

If still no joy then please post the file .node-red/package.json

**[Edit]** If you haven't done it yet, then if you also copied package-lock.json across then delete that file before running npm install. That will make sure it installs the latest versions of everything.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [18 December 2022 02:13 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/5 "2022-12-18T02:13:38Z")

</div>

I did not copy any folders, the nodes were downloaded using palette manager.

I used the MySQL node. In fact when I first imported the flow the DB nodes were blank. Then when I downloaded the nodes through palette manager they were automatically selected to the flow, so I guess the system detected that t was the most appropriate thing.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [18 December 2022 03:18 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/6 "2022-12-18T03:18:52Z")

</div>

Also is there a way to install node-red version 2?

---

<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:** [18 December 2022 10:14 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/7 "2022-12-18T10:14:06Z")

</div>

Can you post the file package.json please from your .node-red directory. Then we can see which nodes you have installed and possibly identify the problematic one.

> [@Evan7](#):
>
> is there a way to install node-red version 2

`npm install -g --unsafe-perm node-red@a.b.c`

Where a.b.c is the version you want to install

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [18 December 2022 10:41 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/8 "2022-12-18T10:41:20Z")

</div>

[package.json](https://discourse.nodered.org/uploads/short-url/zv3N1wqopVAGxpwRhmjbvPJxPbR.json) (415 Bytes)  
here we go bro . Hope this helps.

---

<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:** [18 December 2022 10:57 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/9 "2022-12-18T10:57:12Z")

</div>

Pasting package.json inline so that it is easier to see

```auto
{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "dashboard-evi": "~1.0.2",
        "node-red-contrib-data-table-viewer": "~0.0.5",
        "node-red-contrib-tabletojson": "~1.0.3",
        "node-red-dashboard": "~3.2.3",
        "node-red-node-mysql": "~1.0.3",
        "node-red-node-ui-table": "~0.4.3"
    }
}

```

Are you using dashboard-evi? I would not be surprised if that is the problem.  
If you want to remove it then go into your .node-red folder and run  
`npm remove dashboard-evi`  
then try starting node-red again.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [18 December 2022 22:25 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/11 "2022-12-18T22:25:26Z")

</div>

yes I am using dashboard EVI. Just noticed the package. I deleted it and started node red again but I still get the same error.

# Welcome to Node-RED

19 Dec 03:50:10 - [info] Node-RED version: v3.0.2  
19 Dec 03:50:10 - [info] Node.js version: v18.12.1  
19 Dec 03:50:10 - [info] Windows\_NT 10.0.19044 x64 LE  
19 Dec 03:50:12 - [info] Loading palette nodes  
19 Dec 03:50:28 - [error] Failed to start server:  
19 Dec 03:50:28 - [error] TypeError: Cannot read properties of undefined (reading 'forEach')  
at Object.addModule (C:\Users\myname\AppData\Roaming\npm\node\_modules\node-red\node\_modules@node-red\registry\lib\registry.js:195:27)  
at C:\Users\myname\AppData\Roaming\npm\node\_modules\node-red\node\_modules@node-red\registry\lib\loader.js:153:34  
C:\Users\myname\>

---

<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:** [19 December 2022 07:44 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/12 "2022-12-19T07:44:52Z")

</div>

> [@Evan7](#):
>
> . I deleted it

Delete isn't a good word to use about installed nodes. What exactly did you do?

If you start node red in safe mode does it start up ok? If it does make sure you have the latest versions of all nodes.  
`node-red --safe`

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [19 December 2022 13:40 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/13 "2022-12-19T13:40:26Z")

</div>

I removed the node using the command you provided. However, the issue is still there even when I start it in safe mode. Cant I completely delete node-red and install version 2 ? if its a good move how do I do that.

---

<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:** [19 December 2022 13:58 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/14 "2022-12-19T13:58:30Z")

</div>

It would be good if we could isolate the problem before downgrading node-red. Then others will not fall into the hole.

If possible first please check that dashboard-evi has disappeared from package.json. If it has then go into your .node-red folder and run  
`npm remove node-red-contrib-data-table-viewer`  
and  
`npm remove node-red-contrib-tabletojson`  
and check they have also gone from package.json.  
Then restart node red and see if it is ok (apart from the fact that it complains about missing nodes). If it is then install one of those via the menu Manage Palette and restart node-red, and if still ok do the same with the other. Possibly that will tell us that one of those is the problem.

If you still need to downgrade node-red then you don't need to remove the current version, just install the earlier one using the command I posted, and restart node-red.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [20 December 2022 17:57 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/15 "2022-12-20T17:57:56Z")

</div>

Those two nodes are very important to me, unless you have a good alternative. BTW the name of the database which the db node connects to is "readings"

---

<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:** [20 December 2022 18:14 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/16 "2022-12-20T18:14:12Z")

</div>

Try removing those nodes in order to identify whether one of those is the problem. Once that is done you can reinstall (which will give you the latest versions) which may fix it (I notice one was updated a few days ago). If it doesn't fix it you can report the issue to the author and downgrade node red. If the node gets fixed then you can upgrade node red again.

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [27 December 2022 19:13 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/17 "2022-12-27T19:13:06Z")

</div>

I removed the two nodes yet still I get an error.

```auto
Welcome to Node-RED
===================

28 Dec 00:39:25 - [info] Node-RED version: v2.1.1
28 Dec 00:39:25 - [info] Node.js version: v18.12.1
28 Dec 00:39:25 - [info] Windows_NT 10.0.19044 x64 LE
28 Dec 00:39:26 - [info] Loading palette nodes
28 Dec 00:39:54 - [info] Dashboard version 3.2.3 started at /ui
28 Dec 00:39:56 - [warn] Missing node modules:
28 Dec 00:39:56 - [warn] - dashboard-evi (1.0.2): ui_base, ui_button, ui_dropdown, ui_switch, ui_slider, ui_numeric, ui_text_input, ui_date_picker, ui_colour_picker, ui_form, ui_text, ui_gauge, ui_chart, ui_audio, ui_toast, ui_ui_control, ui_template, ui_link, ui_tab, ui_group, ui_spacer
28 Dec 00:39:56 - [warn] - node-red-contrib-data-table-viewer (0.0.5): table-viewer
28 Dec 00:39:56 - [info] Removing modules from config
28 Dec 00:39:56 - [error] Failed to start server:
28 Dec 00:39:56 - [error] TypeError: Cannot read properties of undefined (reading 'forEach')
    at removeNode (C:\Users\myname\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\registry\lib\registry.js:236:18)
    at Object.cleanModuleList (C:\Users\myname\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\registry\lib\registry.js:619:29)
    at C:\Users\myname\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\runtime\lib\index.js:195:34

```

---

<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:** [28 December 2022 13:36 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/18 "2022-12-28T13:36:56Z")

</div>

In post #10 you posted:

> [@Evan7](#):
>
> `19 Dec 03:50:10 - [info] Node-RED version: v3.0.2`

Now you have

> [@Evan7](#):
>
> `28 Dec 00:39:25 - [info] Node-RED version: v2.1.1`

What is going on?

---

<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:** [3 January 2023 09:57 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/19 "2023-01-03T09:57:38Z")

</div>

Did you work out what is going on with this problem?

---

<div class="post-metadata">

**Author:** ![Evan7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/evan7/32/64141_2.png) [@Evan7](https://discourse.nodered.org/u/Evan7)\
**Post date:** [11 January 2023 17:47 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/20 "2023-01-11T17:47:37Z")

</div>

Hey Col sorry about the delay. So I tried downgrading as well but it did not work. Also even after removing the elements that you recommended I still get the same error.

---

<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:** [12 January 2023 09:37 UTC](https://discourse.nodered.org/t/error-starting-node-red/72350/21 "2023-01-12T09:37:34Z")

</div>

Temporarily rename your .node-red folder to something else and restart node-red. That will restart node-red with an empty flows file. If that fails then your node-red install is messed up, so re-install it. If it is ok then you can import the flows again and try again.

[Next page](https://discourse.nodered.org/t/error-starting-node-red/72350.md?page=2)
