# NODE\_FUNCTION\_ALLOW\_BUILTIN with jsdom

**URL:** <https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879>\
**Category:** Questions\
**Created:** [February 4, 2025, 11:57am UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879 "2025-02-04T11:57:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fablan1](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/fablan1/32/56180_2.png) [@fablan1](https://community.n8n.io/u/fablan1)\
**Post date:** [February 4, 2025, 11:57am UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879/1 "2025-02-04T11:57:59Z")

</div>

## 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:

 ![Bildschirmfoto 2025-02-04 um 10.04.38](https://europe1.discourse-cdn.com/n8n/original/3X/7/9/79726988da6ae08a9d4d685f08b9b14b4ef0fcc7.png)

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:

```auto
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:

```auto
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:

 ![Bildschirmfoto 2025-02-04 um 12.53.57](https://europe1.discourse-cdn.com/n8n/original/3X/5/6/56e7182b02d86174335158b0b8fbe439168bf423.png)

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

---

<div class="post-metadata">

**Author:** ![Digital](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/digital/32/56942_2.png) [@Digital](https://community.n8n.io/u/Digital)\
**Post date:** [February 10, 2025, 10:50am UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879/2 "2025-02-10T10:50:55Z")

</div>

Maybe have a look @ NODE\_FUNCTION\_ALLOW\_EXTERNAL=

---

<div class="post-metadata">

**Author:** ![fablan1](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/fablan1/32/56180_2.png) [@fablan1](https://community.n8n.io/u/fablan1)\
**Post date:** [February 10, 2025, 11:07am UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879/3 "2025-02-10T11:07:59Z")

</div>

@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:

> <https://github.com/n8n-io/n8n/issues/13094>
>
> \## 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}

---

<div class="post-metadata">

**Author:** ![Digital](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/digital/32/56942_2.png) [@Digital](https://community.n8n.io/u/Digital)\
**Post date:** [February 10, 2025, 11:34am UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879/4 "2025-02-10T11:34:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [February 21, 2025, 9:18pm UTC](https://community.n8n.io/t/node-function-allow-builtin-with-jsdom/74879/5 "2025-02-21T21:18:04Z")

</div>

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