# How to debug Function "Error: Module not allowed"

**URL:** <https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177>\
**Category:** General\
**Tags:** function-node\
**Created:** [5 October 2024 11:30 UTC](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177 "2024-10-05T11:30:02Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![MadTooler](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/madtooler/32/76728_2.png) [@MadTooler](https://discourse.nodered.org/u/MadTooler)\
**Post date:** [14 October 2024 12:19 UTC](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177/21 "2024-10-14T12:19:34Z")

</div>

My pi is setup with user testpi. therefore

> /home/testpi/.node-red/settings.js

is the file I have been working with. I only asked about the other after you rightly checked if I was editing the right one. The problem was I did have a sudo in the node-red start (didn't mean to and probably muscle memoried with the keyboard in error)! Removing that and it works. Beyond that, I also wasn't aware admin privilege's would use different settings.js and glazed over the /root as my brain said it really meant the home/... location. I hate when I do that, even more when I waste others' time in the process.

Looks like I am up and running until I fall on my face again 🤕  
Thanks for dragging me to the solution!

---

<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 October 2024 12:31 UTC](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177/22 "2024-10-14T12:31:44Z")

</div>

> [@MadTooler](#):
>
> The problem was I did have a sudo in the node-red start

Do you realise that the command `node-red start` runs node red using a flows file called `start.json`? Perhaps you meant to use the command `node-red-start` which runs node red as a service with the default flows file (usually .node-red/flows.json).

---

<div class="post-metadata">

**Author:** ![MadTooler](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/madtooler/32/76728_2.png) [@MadTooler](https://discourse.nodered.org/u/MadTooler)\
**Post date:** [14 October 2024 13:16 UTC](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177/23 "2024-10-14T13:16:44Z")

</div>

Good to know. I should be running them as a service. My notes are not always literals as opposed to my code formatted or quoted blocks that are. Either way, I will check how it is being started to confirm. 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:** [12 January 2025 13:17 UTC](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177/24 "2025-01-12T13:17:39Z")

</div>

Closed on 12 January 2025 13:17 UTC

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

[Previous page](https://discourse.nodered.org/t/how-to-debug-function-error-module-not-allowed/92177.md?page=1)
