From c701bdc3be0983294a1e35d100c40b5767c74345 Mon Sep 17 00:00:00 2001 From: qinjian Date: Thu, 11 Sep 2025 09:13:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=20README.md=20?= =?UTF-8?q?=E5=92=8C=20package-app.sh=EF=BC=8C=E6=B7=BB=E5=8A=A0=20Node.js?= =?UTF-8?q?=20=E5=AE=89=E8=A3=85=E7=9A=84=20root=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 ++++++++++++++++-- script/package-app.sh | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f62b51b..e8ed102 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # 无源标靶上位机 - ## 开发注意事项 - 请确保在开发环境中,`server/tcpProxy/index.js` 文件中的 `TCP_HOST` 设置为下位机的实际 IP 地址 @@ -8,9 +7,24 @@ - 确保在生产环境中,`client\src\sections\wuyuanbiaoba\components\CameraView.jsx`,摄像头流的 streamUrl 指向正确的地址 - 提交代码前,请将 `streamUrl` 设置回去 - ## 部署说明 + ### 部署步骤 + +**特别注意** +确保下位机已经安装了 nodejs 环境,并且版本在 20 以上,注意,nodejs 环境必须是 root 用户可用的,因为服务自启动需要 root 权限。 + +#### nodejs 安装指南 + +```shell +sudo su - +# 安装 nvm +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +source ~/.bashrc +nvm install 20 +nvm use 20 +``` + 1. 从项目的 [release](https://gitea.anxinyun.cn/qinjian/wuyuanbiaoba_web/releases) 页面下载最新的打包文件,如 `wuyuanbiaoba-web-x.x.x.tar.gz` 2. 上传到服务器的临时目录,如 `/tmp/folder/`(这里最好建立一个新的目录存放压缩文件) 3. 进入该目录,解压文件 `tar -xzf wuyuanbiaoba-web-x.x.x.tar.gz` diff --git a/script/package-app.sh b/script/package-app.sh index c7d4f75..d00822f 100644 --- a/script/package-app.sh +++ b/script/package-app.sh @@ -55,7 +55,7 @@ fi # 检查 Node.js 是否安装 if ! command -v node &> /dev/null; then - echo "错误: Node.js 未安装。请先安装 Node.js 20+" + echo "错误: Node.js 未安装。请为 root 用户安装 Node.js 20+" exit 1 fi