I wonder why I’m seeing npm command not found
on my instance following this instructions:
Community Node installation with N8N running in queue mode :
We do this for queue mode. We actually create a named docker volume, install the community nodes there, and then mount that to all our n8n containers:
To create/update the volume and community nodes:
docker volume create n8n-custom-nodes
# Set the directory permissions to the node user
docker run --rm \
-v n8n-custom-nodes:/custom \
--entrypoint /bin/sh \
n8nio/n8n \
-c "chown -R 1000:1000 /custom"
# Install the community nodes
docker run --rm \
-v n8n-custom-nodes:/custom \
n8nio/n8n \
npm install --prefix /custom n8n-nodes-ldap n8n-nodes-mjml
Is that output expected? Do I need to install npm on this volume?
n8n version: latest
Database (default: SQLite): postgres
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via Docker Compose
Operating system: Debian 12
n8n
February 22, 2024, 1:46pm
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
n8n version:
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
1 Like
I think the new docker containers have changed the CMD. I’ll see if I can grab the new commands
Try this using the entrypoint
argument
# Create the share node container
docker volume create n8n-custom-nodes
# Set the directory permissions to the node user
docker run --rm \
-v n8n-custom-nodes:/nodes \
--entrypoint chown \
n8nio/n8n \
-R node:node /nodes
# Install the community nodes
docker run --rm \
-v n8n-custom-nodes:/nodes \
--entrypoint npm \
n8nio/n8n \
install --prefix /nodes n8n-nodes-ldap n8n-nodes-mjml
This is then mounted into /home/node/.n8n/nodes
:
[..]
volumes:
- n8n-custom-nodes:/home/node/.n8n/nodes
[..]
2 Likes
Jon
February 22, 2024, 11:01pm
5
I do something similar, I have a volume from my host that I bind and I just install the nodes on the host with npm and it does the trick.
This docker solution is cleaner though, I like it.
1 Like
I fear for version compatibility issues. What I do but didn’t capture above is use the same docker tag as what I’m running, so any errors should hopefully surface early
2 Likes
Thanks for your quick reply. I tried your updated instructions and I get this:
chown: /nodes: Operation not permitted
I wonder if I’m missing something or it’s releated to my own instance.
Jon
February 23, 2024, 4:18pm
8
I suspect the owner could be root so you may need to run the docker run command with -u root
to use the root user… or -U
I can never remember the case for it.
1 Like
system
Closed
March 1, 2024, 4:19pm
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.