It is theoretically also possible with the docker image but much more messy as you have to mount each module you need separate. For “sugar-date” that would for example additionally be “sugar-core” as “sugar-'date” depends on it. The more complex the module you need the more modules that would be. So for it to work you would have to:
- npm install “sugar-date” (or whatever you want) in a folder (in this example it would be
~/whereever-you-have-the-module
) - Then start the n8n container kind of like this:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e NODE_FUNCTION_ALLOW_EXTERNAL=sugar-date \
-v ~/.n8n:/root/.n8n \
-v ~/whereever-you-have-the-module/node_modules/sugar-core:/usr/local/lib/node_modules/sugar-core \
-v ~/whereever-you-have-the-module/node_modules/sugar-date:/usr/local/lib/node_modules/sugar-date \
n8nio/n8n:0.51.0