From 213a9d4f1c0fa2a7b7b18b6113363ce578ca2979 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Sun, 31 May 2026 15:35:48 +0330 Subject: [PATCH] Debug next not found: add diagnostic + use direct node invocation Replace `npm run build` with `node node_modules/next/dist/bin/next build` to bypass PATH/symlink resolution issues on Alpine. Also adds a diagnostic `ls node_modules/.bin/next` so CI logs show whether the binary is present. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1185ada..f47986f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,10 @@ RUN if [ -n "$NPM_TOKEN" ]; then \ ENV NEXT_TELEMETRY_DISABLED=1 COPY . . -RUN npm run build +# Diagnose what's in .bin after install, then invoke next directly via node +# to bypass any PATH / symlink resolution issues with `npm run`. +RUN ls node_modules/.bin/next 2>&1 || echo "WARN: next not in .bin" ; \ + node node_modules/next/dist/bin/next build # --------------------------------------------------------------------------- # 2. Runner — minimal image. Standalone server + static assets only.