Auth0 npm dependency does not work inside a Realm function

I am trying to create a Realm function that has requires the auth0 npm package. Regardless of the fact that I am haivng trouble uploading the dependency through the commandline, I have managed to upload it through the Realm UI but the function crashes when invoked.
This is the error message:

failed to execute source for ‘node_modules/auth0/src/index.js’: FunctionError: failed to execute source for ‘node_modules/auth0/src/management/index.js’: FunctionError: failed to execute source for ‘node_modules/rest-facade/src/index.js’: FunctionError: failed to execute source for ‘node_modules/rest-facade/src/Client.js’: FunctionError: failed to execute source for ‘node_modules/superagent-proxy/index.js’: FunctionError: failed to execute source for ‘node_modules/proxy-agent/index.js’: FunctionError: failed to execute source for ‘node_modules/pac-proxy-agent/dist/index.js’: FunctionError: failed to execute source for ‘node_modules/get-uri/dist/index.js’: FunctionError: failed to execute source for ‘node_modules/get-uri/dist/file.js’: FunctionError: failed to execute source for ‘node_modules/fs-extra/lib/index.js’: FunctionError: failed to execute source for ‘node_modules/fs-extra/lib/fs/index.js’: FunctionError: failed to execute source for ‘node_modules/graceful-fs/graceful-fs.js’: TypeError: Object prototype may only be an Object or null: undefined

I’ve installed the dep using npm install as well as tried with yarn.