jdkdev
June 18, 2022, 6:34pm
1
Hi fellow n8nians!
Can someone point me to some docs or explain what access I have to nodeJS or browser API in a Function Item(s) Node
?
Specifically, I was trying to get some things like:
const fs = require('fs')
const path = require('path')
const util = require('util')
and they error out with
ERROR:Access denied to require 'fs'
What are the limitations of a Function Item
Node?
Can I access nodeJs in a different way?
Thanks,
Jordan
jan
June 18, 2022, 9:43pm
2
You do not have any access to the browser API. You can however use own or built-in Node.js JavaScript libraries if you give access them:
https://docs.n8n.io/hosting/configuration/#use-built-in-and-external-modules-in-function-nodes
jdkdev
June 18, 2022, 10:19pm
3
Thanks Jan!
And sorry, I think I knew that from a while back…but forgot.
Follow up, I think I remember some docs about adding your own npm modules to the n8n instance other than those natively included as part of n8n.
Can you point me to that?
Best,
Jordan
mig82
May 16, 2023, 11:34am
4
Is there a workaround for cloud-hosted N8N? I need to use TextEncoder but can’t require it from the util package.