Error: Loading package of custom node

Error of loading the package of custom node named “n8n-nodes-ibm-db2” on Docker.

Hello, everyone.
Now, I am building a custom node for IBM DB2 using the Node.js package.
The Link of the node package is below:

I host the custom n8n on Docker, so I make a custom node run it.
and get the error message.

Error loading package "n8n-nodes-ibm-db2" :The specified package could not be loaded Cause: Could not locate the bindings file. Tried: → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/build/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/build/Debug/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/build/Release/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/out/Debug/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/Debug/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/out/Release/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/Release/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/build/default/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/compiled/20.19.2/linux/x64/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/addon-build/release/install-root/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/addon-build/debug/install-root/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/addon-build/default/install-root/odbc_bindings.node → /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules/ibm_db/lib/binding/node-v115-linux-x64/odbc_bindings.node

Here is my dockerfile code:

# ----------- STAGE 1: Builder -----------
FROM node:18-slim AS builder

WORKDIR /app

# Install build tools
RUN apt-get update && \
    apt-get install -y build-essential python3 curl && \
    rm -rf /var/lib/apt/lists/*

# Initialize and install your custom node and ibm_db
RUN npm init -y
# NOTE: Replace with your actual package path or Git URL if it's private
RUN npm install n8n-nodes-ibm-db2 ibm_db

# ----------- STAGE 2: Final Image -----------
FROM n8nio/n8n:1.95.2

# Copy node_modules + package files from builder to n8n's /data
COPY --from=builder /app/node_modules /data/node_modules
COPY --from=builder /app/package.json /data/package.json
COPY --from=builder /app/package-lock.json /data/package-lock.json

# If you have DB2 CLI driver to install (example for Ubuntu/debian based):
# Add your DB2 driver files or download link here if needed
# Example placeholder:
# ADD ibm_data_server_driver_for_odbc_cli.tar.gz /opt/ibm/db2
# RUN cd /opt/ibm/db2 && ./installDSDriver

WORKDIR /data

I don’t know the reason for this issue.

My n8n instance

  • n8n version: 1.95.2
  • Running n8n via Docker: 26.1.3
  • Operating system: Linux

I need your help.
If anybody knows about this problem, please share your experience.
Thank you.

Hi @Patrick_King,

It looks like your node is looking for some drivers in a different location then where you’re installing it. The error message shows it’s looking for the driver in /home/node/.n8n/nodes/node_modules/n8n-nodes-ibm-db2/node_modules, but it’s not able to find them there. Potentially, because you are installing the drivers in /opt/ibm/db2?

I’m not sure how your node works, or what the drivers are it’s looking for, but I would start looking there. Potentially changing the install location of the drivers, or making sure it’s looking for the drivers in the right location, might help you fix this issue. Good luck!

Hi, n8n Team
Thanks for your message!