From 1a1517dffb19297ab5d6577eb9a7bdf07c4057a1 Mon Sep 17 00:00:00 2001 From: Soham Dasgupta Date: Wed, 14 Jan 2026 00:49:28 +0530 Subject: [PATCH] fix: ensure npm cache directory has correct permissions Fix EACCES permission error when running npx commands (e.g., MCP servers) inside the Docker container. Error that was occurring: npm error code EACCES npm error syscall mkdir npm error path /home/automaker/.npm/_cacache/index-v5/1f/fc npm error errno EACCES npm error Your cache folder contains root-owned files, due to a bug in npm error previous versions of npm which has since been addressed. The fix ensures the /home/automaker/.npm directory exists and has correct ownership before switching to the automaker user in the entrypoint script. --- docker-entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 153f5122..2af347c7 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -47,6 +47,13 @@ fi chown -R automaker:automaker /home/automaker/.cache/opencode chmod -R 700 /home/automaker/.cache/opencode +# Ensure npm cache directory exists with correct permissions +# This is needed for using npx to run MCP servers +if [ ! -d "/home/automaker/.npm" ]; then + mkdir -p /home/automaker/.npm +fi +chown -R automaker:automaker /home/automaker/.npm + # If CURSOR_AUTH_TOKEN is set, write it to the cursor auth file # On Linux, cursor-agent uses ~/.config/cursor/auth.json for file-based credential storage # The env var CURSOR_AUTH_TOKEN is also checked directly by cursor-agent