NODE_FUNCTION_ALLOW_BUILTIN and Docker-Compose

Extension of original question:

If I am using the docker-compose file shouldn’t I be able to add a line to the environment section of n8n then restart and it should work with the proposed solution:

environment: 
- NODE_FUNCTION_ALLOW_BUILTIN=request-promise-native

I am still getting an error “Access denied to require ‘request-promise-native’”"

Thanks in advance.

Using n8n Version: 0.78.0

Welcome to the community @ccarns!

The problem is that “request-promise-native” is not a built-in Node.js library. For that reason do you have to use instead of NODE_FUNCTION_ALLOW_BUILTIN the variable NODE_FUNCTION_ALLOW_EXTERNAL

Then everything should work fine.

Here the documentation:

1 Like

Jan thanks so much for such a fast response.

PS Great work on this project- its amazing.

1 Like

Great to hear that I could help you and that you enjoy n8n!

Have fun!

@jan I was looking at this too and wondering if I can inject the NODE_FUNCTION_ALLOW_BUILTIN variables into n8n\dist\config\index.js if so how, or do I set it in the n8n.cmd file for my windows deployment. Thanks.

Ah no, users are never supposed to change anything within n8n. So in both locations nothing should be changed ever.

If you want to set that environment variable. In windows that should be:

SET NODE_FUNCTION_ALLOW_BUILTIN=crypto

And then you can start n8n normally.