# functionGlobalContext

**URL:** <https://discourse.nodered.org/t/functionglobalcontext/34634>\
**Category:** General\
**Created:** [21 October 2020 12:58 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634 "2020-10-21T12:58:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![niclas.w82](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/niclas.w82/32/31813_2.png) [@niclas.w82](https://discourse.nodered.org/u/niclas.w82)\
**Post date:** [21 October 2020 12:58 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/1 "2020-10-21T12:58:50Z")

</div>

Hi.

Have problem with a function.If i disable the function with // Node-red starts but if i remove // and enable the function i get Error loading settings file: /home/pi/.node-red/settings.js

Any idéa??

![requst disable](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cd4159ce5d32079f0d9cbf83c2995eceb5f50f9f.jpeg)

 ![requst](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fafd360ef071c8229ca63beaad23441d853e03d2.jpeg)

---

<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:** [21 October 2020 13:51 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/2 "2020-10-21T13:51:52Z")

</div>

Have you installed the `request` module?

---

<div class="post-metadata">

**Author:** ![lizzardguki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lizzardguki/32/103637_2.png) [@lizzardguki](https://discourse.nodered.org/u/lizzardguki)\
**Post date:** [21 October 2020 19:52 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/3 "2020-10-21T19:52:40Z")

</div>

Does it just needs to be installed in the node-red folder or globally, or does it have to be mentioned inside package.json ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2020 19:54 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/4 "2020-10-21T19:54:56Z")

</div>

Fairly certain it can be installed either `-g` globally or in the node-red folder. Just so long as it is resolved by `require` like any regular node application.

---

<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:** [21 October 2020 19:58 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/5 "2020-10-21T19:58:36Z")

</div>

Installing it locally will automatically put it in package.json. So you should just need to go to your .node-red folder and  
`npm install request`

---

<div class="post-metadata">

**Author:** ![lizzardguki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lizzardguki/32/103637_2.png) [@lizzardguki](https://discourse.nodered.org/u/lizzardguki)\
**Post date:** [21 October 2020 20:01 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/6 "2020-10-21T20:01:16Z")

</div>

The double slashes are used for commenting the same.  
This part after slashes won't be executed!

---

<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:** [20 December 2020 20:01 UTC](https://discourse.nodered.org/t/functionglobalcontext/34634/7 "2020-12-20T20:01:28Z")

</div>

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