From 41252ec2cb4865a6779d2ab7d503569c58a3c7aa Mon Sep 17 00:00:00 2001 From: john Date: Mon, 29 Jun 2026 10:02:54 +0800 Subject: [PATCH] fix(restart): invoke vite preview binary directly on 103 npm exec misparsed --config on Node 24/npm 11, causing preview to bind 4173 without /ops proxy and failing release health checks. Co-authored-by: Cursor --- scripts/remote_restart.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/remote_restart.sh b/scripts/remote_restart.sh index db20fb7..407c0c3 100755 --- a/scripts/remote_restart.sh +++ b/scripts/remote_restart.sh @@ -73,7 +73,9 @@ if ! curl -sf "http://127.0.0.1:${API_PORT}/health" >/dev/null; then fi echo "==> 启动 vite preview @ ${WEB_HOST}:${PORT} (base=${BASE_PATH})..." -nohup "${NPM_BIN}" exec vite preview --config scripts/vite-preview.config.mjs >>"${LOG}" 2>&1 & +VITE_BIN="${ROOT}/node_modules/vite/bin/vite.js" +[[ -f "${VITE_BIN}" ]] || { echo "❌ 缺少 ${VITE_BIN}" >&2; exit 1; } +nohup "${NODE_BIN}" "${VITE_BIN}" preview --config scripts/vite-preview.config.mjs >>"${LOG}" 2>&1 & echo $! >"${PID_FILE}" sleep 3