Unable to install NPM Module (v 1.31.1)

Hi Team,
I am facing an issue with the latest image (v 1.31.1). Docker is throwing an error while building.

docker-compose.yml

version: "3.7"
services:
  n8n:
    container_name: n8n-server
    build:
      context: .
      tags:
        - myn8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_PORT=5678
      - NODE_FUNCTION_ALLOW_BUILTIN=*
      - NODE_FUNCTION_ALLOW_EXTERNAL=*
    volumes:
      - n8n_data:/home/node/.n8n
      - n8n_config:/root/.n8n
      - /home/ubuntu/n8n/n8n-local-files:/files

volumes:
  n8n_data:
    external: true
  n8n_config:
    external: true

Dockerfile

FROM n8nio/n8n:latest
USER root
WORKDIR /usr/local/lib/node_modules/n8n
RUN npm install mailparser papaparse

It works when I change it to FROM n8nio/n8n:1.31.0

What is the error message (if any)?

25.36 npm ERR! code ERESOLVE
25.36 npm ERR! ERESOLVE could not resolve
25.36 npm ERR!
25.36 npm ERR! While resolving: [email protected]
25.36 npm ERR! Found: [email protected]
25.36 npm ERR! node_modules/n8n-nodes-base
25.36 npm ERR!   n8n-nodes-base@"1.31.1" from @n8n/[email protected]
25.36 npm ERR!   node_modules/@n8n/n8n-nodes-langchain
25.36 npm ERR!     @n8n/n8n-nodes-langchain@"0.16.1" from the root project
25.36 npm ERR!   n8n-nodes-base@"1.31.1" from the root project
25.36 npm ERR!
25.36 npm ERR! Could not resolve dependency:
25.36 npm ERR! peer n8n-nodes-base@"1.31.0" from [email protected]
25.36 npm ERR! node_modules/n8n-core
25.36 npm ERR!   n8n-core@"1.31.0" from the root project
25.36 npm ERR!
25.36 npm ERR! Conflicting peer dependency: [email protected]
25.36 npm ERR! node_modules/n8n-nodes-base
25.36 npm ERR!   peer n8n-nodes-base@"1.31.0" from [email protected]
25.36 npm ERR!   node_modules/n8n-core
25.36 npm ERR!     n8n-core@"1.31.0" from the root project
25.36 npm ERR!
25.36 npm ERR! Fix the upstream dependency conflict, or retry
25.36 npm ERR! this command with --force or --legacy-peer-deps
25.36 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
25.36 npm ERR!
25.36 npm ERR!
25.36 npm ERR! For a full report see:
25.36 npm ERR! /root/.npm/_logs/2024-03-06T12_20_26_672Z-eresolve-report.txt
25.37
25.37 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-03-06T12_20_26_672Z-debug-0.log

Information on your n8n setup

  • n8n version: 1.31.1
  • Database (default: SQLite): SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04

Hey @Boris_Makena,

Welcome to the community :cake:

Do you get the same issue if you try…

FROM n8nio/n8n:latest
USER root
RUN npm install -g mailparser papaparse
USER node

This worked.

Thanks.

1 Like

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