Crashes after adding an external module

I'm trying to add an external module to get signal strengt from my modem.
I installed the package while at the same settings folder with:
npm install dialog-router-api --save

I confirmed the module exists in ./node_modules and I used it on a command-line js script.

So as per documentation, I added the module to settings.js:

    functionGlobalContext: {
      draModule:require('dialog-router-api')
    },

But then, node-red crashes at start:

> node-red-docker@1.0.0 start /usr/src/node-red
Failed to start server:
TypeError: typeMap[type].map is not a function
    at Mime.define (/usr/src/node-red/node_modules/mime/Mime.js:41:36)
    at new Mime (/usr/src/node-red/node_modules/mime/Mime.js:12:10)
    at Object.<anonymous> (/usr/src/node-red/node_modules/mime/index.js:4:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1

npm ERR! Failed at the node-red-docker@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR!     /usr/src/node-red/.npm/_logs/2019-08-29T09_08_10_682Z-debug.log
$ cat /usr/src/node-red/.npm/_logs/2019-08-29T09_07_30_495Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'start',
1 verbose cli   '--',
1 verbose cli   '--userDir',
1 verbose cli   '/data' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose config Skipping project config: /usr/src/node-red/.npmrc. (matches userconfig)
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info lifecycle node-red-docker@1.0.0~prestart: node-red-docker@1.0.0
7 info lifecycle node-red-docker@1.0.0~start: node-red-docker@1.0.0
8 verbose lifecycle node-red-docker@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle node-red-docker@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/node-red/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle node-red-docker@1.0.0~start: CWD: /usr/src/node-red
11 silly lifecycle node-red-docker@1.0.0~start: Args: [ '-c',
11 silly lifecycle   'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"' ]
12 silly lifecycle node-red-docker@1.0.0~start: Returned: code: 1  signal: null
13 info lifecycle node-red-docker@1.0.0~start: Failed to exec start script
14 verbose stack Error: node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
14 verbose stack     at EventEmitter.emit (events.js:198:13)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack     at ChildProcess.emit (events.js:198:13)
14 verbose stack     at maybeClose (internal/child_process.js:982:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
15 verbose pkgid node-red-docker@1.0.0
16 verbose cwd /usr/src/node-red
17 verbose Linux 4.4.41-1.ph1
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/data"
19 verbose node v10.16.0
20 verbose npm  v6.9.0
21 error code ELIFECYCLE
22 error errno 1
23 error node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
23 error Exit status 1
24 error Failed at the node-red-docker@1.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Does anyone knows what I've done wrong?
Thank you.

At a guess, the stack trace mentions this module so I suspect you need to initialise it with something rather than a simple require.

Indeed the sample code in the readme shows....

var router = require('dialog-router-api').create({
    gateway: '192.168.8.1'
    // The IP address of your router, can be found by doing
    // ipconfig on windows or netstat -r on linux (right under 'Gateway')
  });

Perhaps this module cannot be required or instansiated without calling create and supplying a property.

also, I'm not certain if that is possible in settings.js

Give it a go?