From dba827b9b024d6d8569d193cdbdda8921cb3cce7 Mon Sep 17 00:00:00 2001 From: wuyang6 Date: Mon, 11 May 2026 17:27:40 +0800 Subject: [PATCH] Record npx path for deployment runtime --- README.md | 6 +++++- scripts/deploy-ubuntu.sh | 9 ++++++--- scripts/start-backend.sh | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 84244fd..76e3394 100644 --- a/README.md +++ b/README.md @@ -594,9 +594,13 @@ CLAW_BACKEND_PORT CLAW_FRONTEND_HOST CLAW_FRONTEND_PORT CLAW_API_URL +CLAW_NPM_BIN +CLAW_NPX_BIN +CLAW_NODE_BIN +CLAW_NODE_BIN_DIR ``` -该文件包含敏感信息,只保存在部署机器本地,权限设置为 `600`,并已被 `.gitignore` 忽略。 +其中 Node.js 相关路径会在部署时自动记录,供 systemd 后端/前端服务以及飞书 MCP 等 Node 生态能力使用。该文件包含敏感信息,只保存在部署机器本地,权限设置为 `600`,并已被 `.gitignore` 忽略。 ### 日常更新 diff --git a/scripts/deploy-ubuntu.sh b/scripts/deploy-ubuntu.sh index 9929295..46479c3 100755 --- a/scripts/deploy-ubuntu.sh +++ b/scripts/deploy-ubuntu.sh @@ -264,17 +264,19 @@ build_frontend() { } remember_node_runtime() { - local npm_bin node_bin node_bin_dir tmp_file + local npm_bin npx_bin node_bin node_bin_dir tmp_file npm_bin="$(resolve_npm_bin)" node_bin_dir="$(dirname "${npm_bin}")" export PATH="${node_bin_dir}:${PATH}" node_bin="$(PATH="${node_bin_dir}:${PATH}" command -v node || true)" + npx_bin="$(PATH="${node_bin_dir}:${PATH}" command -v npx || true)" tmp_file="$(mktemp)" - grep -v -E '^(# systemd 用户服务不会读取交互式 shell 配置|export CLAW_(NPM_BIN|NODE_BIN|NODE_BIN_DIR)=)' "${ENV_FILE}" >"${tmp_file}" || true + grep -v -E '^(# systemd 用户服务不会读取交互式 shell 配置|export CLAW_(NPM_BIN|NPX_BIN|NODE_BIN|NODE_BIN_DIR)=)' "${ENV_FILE}" >"${tmp_file}" || true cat >>"${tmp_file}" <