NODE_FUNCTION_ALLOW_BUILTIN with jsdom

Describe the problem/error/question

hello i have already searched here for a solution but seems there is no correct solution.
I can’t use built in npm packages from n8n. In this example: “jsdom”.

The npm package is installed and available in the Docker container:

I use the Docker Compose variant for Digital Ocean and followed the set up tutorial step by step.

This is what my docker-compose.yml file looks like:

version: "3.7"

services:
  caddy:
    image: caddy:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - caddy_data:/data
      - ${DATA_FOLDER}/caddy_config:/config
      - ${DATA_FOLDER}/caddy_config/Caddyfile:/etc/caddy/Caddyfile

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - 5678:5678
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - NODE_FUNCTION_ALLOW_BUILTIN=jsdom
    volumes:
      - n8n_data:/home/node/.n8n
      - ${DATA_FOLDER}/local_files:/files

volumes:
  caddy_data:
    external: true
  n8n_data:
    external: true

When I run the following commands:

docker compose down
docker compose build
docker compose up -d

when I try to open the package in the code node, the package (jsdom) is not recognized:

Do I miss anything here? This should work for built in npm Modules from n8n?

Hope someone can help me out :slight_smile:

Information on your n8n setup

  • **n8n version:Lastest
  • Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker compose / Digital Ocean

Maybe have a look @ NODE_FUNCTION_ALLOW_EXTERNAL=

@Digital seems to e a Bug as I can use the npm package with no issues. It is more a linter issue. See report here:

I also had strange side effects and then went to the n8n:next image with my dev docker environment and it was up again.