How to install npm modules?
Solved
N8N
-
@nebulon my proposal is to install the modules when we build the image from the Dockerfile. I open to any other solution.
The modules installed will be on the read-only filesystem. See the Diff from this source
... # Add a script to install npm packages from env.sh COPY install_packages_from_env.sh /app/pkg/ RUN chmod +x /app/pkg/install_packages_from_env.sh ... # install custom npm modules from the env.sh on the NODE_FUNCTION_ALLOW_EXTERNAL RUN /app/pkg/install_packages_from_env.sh /app/data/env.sh ...
-
Recently, with nodebb we started experimenting with making the node_modules writable (grudgingly). Maybe we can do the same for n8n.
-
This is implemented in https://docs.cloudron.io/apps/n8n/#custom-node-modules .
@shrey let me know if you get a chance to test it.
-