Can't install community package on docker

Describe the problem/error/question

I’ve used the Self hosted AI starter kit:

which worked fine so far.

Now, I try to install a community node:
https://www.npmjs.com/package/@digital-boss/n8n-nodes-billrun-suitecrm?
Via settings - community nodes and then I receive an error:

What is the error message (if any)?

n8n                | npm command failed
n8n                | Error loading package "n8n-nodes-suitecrm" :Package could not be installed - check logs for details
n8n                | ResponseError: Error loading package "n8n-nodes-suitecrm" :Package could not be installed - check logs for details
n8n                |     at CommunityPackagesController.installPackage (/usr/local/lib/node_modules/n8n/dist/controllers/community-packages.controller.js:81:19)
n8n                |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
n8n                |     at handler (/usr/local/lib/node_modules/n8n/dist/decorators/controller.registry.js:93:24)
n8n                |     at /usr/local/lib/node_modules/n8n/dist/response-helper.js:110:26

Information on your n8n setup

  • n8n version: 1.72.1
  • Database (default: SQLite): Docker one? PostgreSQL?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24

Hey @Chris7935 , to install a community node go to Settings → Community nodes to install it.

Yes, that’s what I did.
And then I got this error there.

I did some more digging, tried it in the docker container via exec.

sudo docker exec 111a60e8d8d4 npm install n8n-nodes-suitecrm
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /home/node/node_modules/mmmagic
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:430:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:442:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:484:16)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Linux 6.8.0-51-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/node/node_modules/mmmagic
npm ERR! gyp ERR! node -v v20.18.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

and then I found that:

So is it possible, that there are some issues with

?

It seems to be an issue with the package itself. I got the same error for “n8n-nodes-suitecrm” but installed successfully different other packages. You might want to contact the package maintainer.

I did some more digging and testing.

It works without any problems in one docker container, that I already had installed since a year or so.

Then I tried a fresh one with a Dockerfile:

FROM n8nio/n8n
USER root
RUN apk add --update python3 py3-pip make

Then, I’d try to install the extension via CLI:

sudo docker exec e58d212e2583 npm install n8n-nodes-suitecrm

And the error is different:

npm ERR! code 1
npm ERR! path /home/node/node_modules/mmmagic
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/node/node_modules/mmmagic/build'
npm ERR!   CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
npm ERR! make: Leaving directory '/home/node/node_modules/mmmagic/build'
npm ERR! make: cc: No such file or directory
npm ERR! make: *** [deps/libmagic/libmagic.target.mk:140: Release/obj.target/libmagic/deps/libmagic/src/apprentice.o] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 6.8.0-51-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/node/node_modules/mmmagic
npm ERR! gyp ERR! node -v v20.18.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

So at least the error list got shorter :laughing:
It seems, parts of python3 py3-pip make have been required to install this node and I got a bit further.

Now looking at mmmagic puzzles me - that seems to be 6 years without any updates but still thousands of downloads.

There seem to be some issues around gyp / mmmagic and installing it on a node v20 - but I can’t figure it out.

Additionally:
If I simply copy the old node docker compose file and spin it up, it’s not working anymore on the copy.
But it is working on the original image.

The docker-compose.yml of the working one is not very different from the current n8n one (not even using Python and custom image like what I’ve tried now.

version: "3.7"

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - NODE_ENV=production
      - WEBHOOK_URL=http://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - n8n_data:/home/node/.n8n
      - /home/user/Software/Docker/n8n/local_files:/files

volumes:
  traefik_data:
    external: true
  n8n_data:
    external: true

Is it possible, that this docker somehow uses my local Python install or similar?
How can I figure out, why I was able to install the module on this one but not on the current one?

Or another idea:
How can I copy the working one (it’s an up to date: n8n Version: 1.73.1, node: v20.18.0 )

bump
Any ideas?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.