Can you please show your docker-compose file?
npm install hello-world-npm should be inside a custom Dockerfile which extends the standard n8n image.
The result should be like this
A part of Docker-compose.yml:
n8n:
#image: n8nio/n8n
build:
context: .
dockerfile: Dockerfile-n8n
user: "1000:1000"
restart: always
depends_on:
- db-n8n
ports:
- "127.0.0.1:5678:5678"
labels:
<SOME TRAEFIK STUFF IF USING TRAEFIK AS REVERSE-PROXY>
environment:
<SOME ENV VARIABLES HERE>
- NODE_FUNCTION_ALLOW_BUILTIN
- NODE_FUNCTION_ALLOW_EXTERNAL
volumes:
- ${DATA_FOLDER}/.n8n:/home/node/.n8n
And then Dockerfile-n8n. Note that I install both system libs + npm packages. System libs are available immediately via Execute Command Node:
ARG tag=latest
FROM n8nio/n8n:$tag
USER root
RUN apk --update add sshpass openssh imagemagick libwebp libwebp-tools ghostscript poppler-utils curl curl-dev libcurl linux-headers g++ gfortran libxml2 libxml2-dev ffmpeg openjdk8-jre libreoffice
RUN apk add --no-cache msttcorefonts-installer fontconfig
RUN update-ms-fonts
RUN npm install -g pdf-image pdf2pic minify [email protected] nunjucks xlsx-template
USER node
Finally, don’t forget about .env file:
NODE_FUNCTION_ALLOW_BUILTIN=*
NODE_FUNCTION_ALLOW_EXTERNAL=luxon,pdf-image,pdf2pic,minify,easy-template-x,pca-js,nunjucks,xlsx-template