# Connection refused after editing settings.js

**URL:** <https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142>\
**Category:** General\
**Created:** [14 September 2018 10:56 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142 "2018-09-14T10:56:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paba](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@paba](https://discourse.nodered.org/u/paba)\
**Post date:** [14 September 2018 10:56 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142/1 "2018-09-14T10:56:20Z")

</div>

Hello there, i have a little problem like the title tells.  
I installed modules like xml2js & fast-csv on my host and want to use those functions inside a function node in nodered.  
So i added the modules to 'functionGlobalContext' inside settings.js (.node-red -\> settings.js)  
but then after restart i cannot connect to nodered in browser, it says err\_connection\_refused.  
btw, nodered is installed in a docker container..  
did i installed the modules the wrong way? what is the problem, i hope somebody can help.  
\*\*i installed the modules globally, but in the root directory..

best regards,  
Paul

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 September 2018 11:40 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142/2 "2018-09-14T11:40:29Z")

</div>

Do you have access to the node-red log to see what error it is hitting?

Can you share exactly what you put in the settings.js file? You've probably accidentally introduced a syntax error in the file which prevents it from being loaded.

---

<div class="post-metadata">

**Author:** ![paba](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@paba](https://discourse.nodered.org/u/paba)\
**Post date:** [14 September 2018 11:50 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142/3 "2018-09-14T11:50:04Z")

</div>

unfortunately, i cannot access the host system.. that means i cannot read the log right?  
I'm only getting access by ssh into the container and through [portainer.io](http://portainer.io) .

this is what i've edited in the settings file  
functionGlobalContext: {  
nodes7:require('nodes7')  
// fast-csv:require('fast-csv'),  
// xml2js:require('xml2js')  
...  
nodes7 is working in a function node but the others wont.

i also installed them right into the .node-red folder but nothing changed

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 September 2018 11:54 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142/4 "2018-09-14T11:54:07Z")

</div>

The fast-csv and xml2js lines are commented out - remove the `//` at the start of them. You'll also need a comma, `,` to separate the nodes7 and fast-csv lines. Finally, you'll need to rename fast-csv as that is not a valid javascript identifier - use `fastCSV` (as an example).

```auto
functionGlobalContext: {
  nodes7:require('nodes7'),
  fastCSV:require('fast-csv'),
  xml2js:require('xml2js')
}

```

And make sure there is a comma separating this whole block from the settings above and below.

---

<div class="post-metadata">

**Author:** ![paba](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@paba](https://discourse.nodered.org/u/paba)\
**Post date:** [14 September 2018 11:59 UTC](https://discourse.nodered.org/t/connection-refused-after-editing-settings-js/3142/5 "2018-09-14T11:59:25Z")

</div>

lol yes for sure, i just commented it out so that i could go on editing my flow 🙂  
but renaming fast-csv worked!! didnt know that the - could cause a problem..  
thank you very much
