I recently enabled task runners on my self hosted instance and lots of my code nodes that use custom npm packages installed in the docker container stopped working with constructor errors.
I note the warning says task runners will be enabled by default soon, so with this in mind, how do we stop the errors?
Hi @Wayne ,
thanks for your question.
Could you please provide some more information?
I’m not an expert in docker, but it might be helpful to see your setup.
Result of my research with the info so far:
Since task runners are separate containers, you must install your npm packages inside them. You can do this by:
Customizing the n8n Docker image to pre-install the required npm packages.
Creating a Dockerfile and adding:
FROM n8nio/n8n:latest
RUN npm install -g your-package-name
If this helped you, please mark my reply as correct solution✅ and give it a like❤️
Have fun!
The issue seems to be that we aren’t using the same set of paths to resolve packages when running inside the task-runner sub-process. This PR should hopefully address that issue.
I have published a custom docker image ghcr.io/n8n-io/n8n:community-83774 with the fix. That way you don’t need to be blocked until the next release.
Can you please try this custom docker image, and let us know if this fixes the issue for you?