Facing issue while configuring the node modules and proxy to the server

I updated the Node modules and configured the n8n proxy correctly. It’s working fine in the terminal, and I can confirm it using npm list inside the container. The n8n proxy is also responding correctly. However, when I check the same through Postman or access the website URL, it’s not working — specifically, requests related to node_modules are failing.

Below is my n8n setup with the environment variables and Dockerfile. Any suggestions on resolving this issue would be appreciated.
docker-compose.yaml:

  n8n:
    build: .
    restart: always
    ports:
      - 5678:5678
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_PORT=5678
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=xxxxxxxxx
      - GENERIC_TIMEZONE=UTC
      - WEBHOOK_URL=https://xxxxxxx.com
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - NODE_FUNCTION_ALLOW_EXTERNAL=playwright,agentql
      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_PATH=/usr/local/lib/node_modules
      - N8N_PROXY=${N8N_PROXY}
Dockerfile:
FROM n8nio/n8n:1.80.0
USER root
RUN npm install -g express playwright agentql
USER node

Where did you find reference to an environment variable named N8N_PROXY? The only one I could find was N8N_PROXY_HOPS. What do you expect it to do?

Search Source Code for N8N_PROXY

Its nothing but updating proxy url to the n8n, which i found from some where from google, to update oxylabs residential proxy url,its working fine in the terminal but not working in the ui, it not working in the client side(frontend).

Maybe N8N_PROXY is an old version of what is now WEBHOOK_URL, N8n_PORT, and/or N8N_HOST. I suspect it isn’t doing anything, or at least it isn’t doing what you think it should be doing.

I would stick with only the things currently in the Deployment Environment Variables documentation. The ones that might help in your situation are:

  • N8N_HOST
  • N8N_TUNNEL_SUBDOMAIN
  • WEBHOOK_URL
  • N8N_PUBLIC_API_ENDPOINT

I also noticed that you are running npm install -g, while building the docker image, as root to install your extra packages. I don’t know the subtleties of how npm works, but it might be worth a try (just to see), to run npm install (without the -g) as the node user. Possibly the file permissions in the container, for npm libs are contributing the troubles.

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