fablan1
February 4, 2025, 11:57am
1
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
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
Digital
February 10, 2025, 10:50am
2
Maybe have a look @ NODE_FUNCTION_ALLOW_EXTERNAL=
fablan1
February 10, 2025, 11:07am
3
@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:
opened 10:02AM - 06 Feb 25 UTC
## Describe the problem/error/question
The n8n linter shows via require that th… e package can not found ("Cannot find module 'jsdom' or its corresponding type declarations.")
- n8n built in package "jsdom" is activated via follwing environment variable: NODE_FUNCTION_ALLOW_BUILTIN=*
- jsdom works without issues but the linter says "Cannot find module 'jsdom' or its corresponding type declarations."
- the same issue for NODE_FUNCTION_ALLOW_EXTERNAL=*
expected behavior:
- npm package are activated via environment variables: NODE_FUNCTION_ALLOW_BUILTIN / NODE_FUNCTION_ALLOW_EXTERNAL
- the n8n linter works without issues
## What is the error message (if any)?
"Cannot find module 'jsdom' or its corresponding type declarations."
## Please share your workflow/screenshots/recording
<img width="634" alt="Image" src="https://github.com/user-attachments/assets/7fe071d7-3a55-40cf-9de9-5c79e688487b" />
```
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
⚠️ WARNING ⚠️ If you have sensitive data in your workflow (like API keys), please remove it before sharing.
```
## Share the output returned by the last node
## Debug info
### core
- n8nVersion: 1.76.2
- platform: docker (self-hosted)
- nodeJsVersion: 20.18.2
- database: sqlite
- executionMode: regular
- concurrency: -1
- license: community
### storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: memory
### pruning
- enabled: true
- maxAge: 336 hours
- maxCount: 10000 executions
### client
- userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/131.0.0.0 safari/537.36
- isTouchDevice: false
Generated at: 2025-02-05T08:26:07.500Z}
Digital
February 10, 2025, 11:34am
4
I also had strange side effects and then went to the n8n:next image with my dev docker environment and it was up again.