From 928b71f2fe02cff097340627c909a003910e772b Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:01:23 +0200 Subject: [PATCH] fix: add missing runtime dependencies for Docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add axios (^1.10.0) for n8n API client - Add zod (^3.25.32) for workflow validation - Update runtime package version to 2.6.2 - Update Dockerfile comment to reflect minimal (not zero) dependencies Fixes Docker runtime error: "Cannot find module 'axios'" introduced by n8n management tools in v2.6.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 2 +- docs/docker-fix-v2.6.2.md | 32 ++++++++++++++++++++++++++++++++ package.runtime.json | 6 ++++-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 docs/docker-fix-v2.6.2.md diff --git a/Dockerfile b/Dockerfile index f5f4e1a..4aea54f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.7 -# Ultra-optimized Dockerfile - no n8n dependencies needed at runtime +# Ultra-optimized Dockerfile - minimal runtime dependencies (no n8n packages) # Stage 1: Builder (TypeScript compilation only) FROM node:20-alpine AS builder diff --git a/docs/docker-fix-v2.6.2.md b/docs/docker-fix-v2.6.2.md new file mode 100644 index 0000000..fbe616d --- /dev/null +++ b/docs/docker-fix-v2.6.2.md @@ -0,0 +1,32 @@ +# Docker Fix for v2.6.2 - Missing Runtime Dependencies + +## Issue +After v2.6.0, the Docker image started failing with: +``` +Error: Cannot find module 'axios' +``` + +## Root Cause +In v2.6.0, we added n8n management tools that require: +- `axios` - For HTTP API calls to n8n instances +- `zod` - For workflow validation schemas + +However, our ultra-optimized Docker image uses `package.runtime.json` which didn't include these new dependencies. + +## Fix +Updated `package.runtime.json` to include: +```json +"axios": "^1.10.0", +"zod": "^3.25.32" +``` + +## Impact +- Docker image size increases slightly (~5MB) but remains much smaller than full n8n dependencies +- No changes needed to Dockerfile itself - just the runtime package list +- Users need to pull the latest Docker image after rebuild + +## Prevention +When adding new features that require additional npm packages, always check: +1. Is the package needed at runtime? +2. If yes, add it to `package.runtime.json` for Docker builds +3. Test the Docker image before release \ No newline at end of file diff --git a/package.runtime.json b/package.runtime.json index e3cf6fb..66c0aa7 100644 --- a/package.runtime.json +++ b/package.runtime.json @@ -1,6 +1,6 @@ { "name": "n8n-mcp-runtime", - "version": "2.4.1", + "version": "2.6.2", "description": "n8n MCP Server Runtime Dependencies Only", "private": true, "dependencies": { @@ -8,7 +8,9 @@ "better-sqlite3": "^11.10.0", "sql.js": "^1.13.0", "express": "^5.1.0", - "dotenv": "^16.5.0" + "dotenv": "^16.5.0", + "axios": "^1.10.0", + "zod": "^3.25.32" }, "engines": { "node": ">=16.0.0"