# How to activate the Global Hooks

**URL:** <https://discourse.nodered.org/t/how-to-activate-the-global-hooks/78251>\
**Category:** General\
**Created:** [7 May 2023 18:54 UTC](https://discourse.nodered.org/t/how-to-activate-the-global-hooks/78251 "2023-05-07T18:54:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![nru2023](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@nru2023](https://discourse.nodered.org/u/nru2023)\
**Post date:** [14 May 2023 12:27 UTC](https://discourse.nodered.org/t/how-to-activate-the-global-hooks/78251/10 "2023-05-14T12:27:20Z")

</div>

Hi, Nick,

I’ve done as you proposed and everything oft he examples (also with modifications) runs excellent.

But if I expand one of them for using sqlite3 module I’ll get errors.

First way : using „require(‚sqlite3‘)“ produces „cannot find module sqlite3“ (sqlite has been installed with npm with and without –g option)

Second way : configuring inside settings.js in the functionGlobalContext as

„sqlite3:require('sqlite3'),“ and using „var sqlite3=global.get('sqlite3');“ with the error „TypeError: global.get is not a function“.

I’ve also tried to activate „externalModules“ with „autoInstall: true“ and „modules: {allowInstall: true,} – no change at all.

Any idea where my mistake may be ?

Kind regards

Fred

---

_[View the full topic](https://discourse.nodered.org/t/how-to-activate-the-global-hooks/78251)._
