Hi @Michu0112, welcome to the community
What should I do to allow my n8n instance to install multiple npm packages? This should be pointed out in documentation what I should exactly do step by step to achieve this.
It sems your goal is flexibility, so the easiest approach would be to set NODE_FUNCTION_ALLOW_EXTERNAL=*
. This allows using all external modules that ship with n8n and is also what I do on my own instance.
If you’d rather specify which modules exactly you want to use you can separate their names using a comma (NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash
).
Seeing you are using docker, these variables would have to be passed on to your container. If you are using the docker run
command to launch n8n you can use the -e
or --env
option to do so, for example:
docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n -e NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash n8nio/n8n:0.208.1
You can then use these modules like so in the Code node:
If you need any modules not shipping with the default n8n docker image you would need to build a custom n8n docker image. This could be done as described over here by @hchris1.
Hope this helps!