Add some apps to run in command executer

Hi guys.
I want to use some python and nodejs apps in n8n command executer. but i don’t know how.
I want to use yt-dlp and puppeteer. searched forum and made a dockerfile and add these lines :

FROM n8nio/n8n
RUN apk update
RUN apk upgrade
RUN apk add --no-cache --update python3 py3-pip
RUN apk add --update nodejs nodejs-npm npm
RUN npm i puppeteer
RUN python3 -m pip install --upgrade yt-dlp

it installs yt-dlp and worksbut it can’t install puppeteer. when i run a js script with puppeteer in it it says :

NodeOperationError: Command failed: node /home/node/.n8n/01.js
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'puppeteer'
Require stack:
- /home/node/.n8n/01.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/node/.n8n/01.js:1:21)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/node/.n8n/01.js' ]
}

    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ExecuteCommand/ExecuteCommand.node.js:74:27)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:447:47

somehow i added puppeteer to n8n.but now it shows another error :

(node:1155) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! spawn /home/node/.n8n/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome ENOENT TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md at onClose (/home/node/.n8n/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:229:20) at ChildProcess.<anonymous> (/home/node/.n8n/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:221:85) at ChildProcess.emit (events.js:315:20) at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) at onErrorNT (internal/child_process.js:465:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) (Use `node --trace-warnings ...` to show where the warning was created) (node:1155) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:1155) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

what should i do.

thanks.

Information on your n8n setup

  • n8n version: latest
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Assuming that, that is the error thrown by a function node, try seeting the env variable NODE_FUNCTION_ALLOW_EXTERNAL=puppeteer .

no its Execute Command node.
somehow i added puppeteer to n8n.but now it shows another error