[Solved] How to use built-in and external modules in Function-Nodes with n8n Desktop (on windows)


I’m using n8n destkop on windows.
It works great.

I would need cheerio in the function to do what I need to.

I saw that you can activate node function with environment variables:

I tried to add an env variable in windows.
And then to use cheerio and I get “ERROR: cheerio is not defined”

How do you do it in windows?

Hi @Sandoche, you can configure environment variables in the n8n-desktop.env file inside the .n8n folder of your home directory (so C:\Users\Sandoche\.n8n\n8n-desktop.env if your Windows username would be Sandoche).

Something like NODE_FUNCTION_ALLOW_EXTERNAL=cheerio or NODE_FUNCTION_ALLOW_EXTERNAL=* should allow you to require cheerio in the Function node.

1 Like

Awesome it works!
Thanks a lot!

1 Like

FYI, the API docs (and my current issue seems to prove) that you need to BE SPECIFIC when specifying
NODE_FUNCTION_ALLOW_EXTERNAL, so =* will not work as expected.