修改配置

This commit is contained in:
vet
2026-04-13 20:16:21 +07:00
parent 446c003b2e
commit c0290cfbf6
2 changed files with 65 additions and 0 deletions

View File

@@ -94,6 +94,8 @@ vim .env.deploy-test
./deploy-test/07-start-frontend.sh
```
> **pcElectron依赖安装**:首次在**无 GitHub SSH 密钥**的服务器上部署时,请先执行 `./deploy-test/00-init-tools.sh`(会配置将 GitHub SSH 地址重写为 HTTPS或见下文「pc 前端 yarn install 失败」。`pc` 目录统一使用 **Yarn**;若存在 `package-lock.json` 会触发 Yarn 混用警告,可删除该文件后仅保留 `yarn.lock`。
---
## 配置文件(`.env.deploy-test`
@@ -266,6 +268,23 @@ TENCENT_SDK_SECRET_KEY=xxx
## 故障排查
### pc 前端 `yarn install` 失败Git SSH / Host key verification failed
现象示例:`git ls-remote ... ssh://git@github.com/electron/node-gyp.git``Host key verification failed``Could not read from remote repository`
| 说明 | 处理 |
|------|------|
| **锁文件** | 仓库中 `pc/yarn.lock``pc/package-lock.json` 已将 `@electron/node-gyp``resolved` 固定为 **`git+https://github.com/electron/node-gyp.git#...`**(无需 SSH。请拉取最新代码后再执行 `yarn install`。 |
| **环境** | 首次部署请执行 `./deploy-test/00-init-tools.sh`,脚本内会通过 `git config url.*.insteadOf``git+ssh://``ssh://git@github.com/``git@github.com:` 重写为 `https://github.com/`。 |
| **仍失败** | 手动执行(与 `00-init-tools.sh` 一致):<br>`git config --global url."https://github.com/".insteadOf "git+ssh://git@github.com/"`<br>`git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"`<br>`git config --global url."https://github.com/".insteadOf "git@github.com:"` |
| **包管理器** | `pc` 使用 **Yarn**。若同时存在 `package-lock.json`Yarn 会警告混用锁文件;可删除 `pc/package-lock.json`,仅保留 `yarn.lock`(与团队约定一致即可)。 |
```bash
cd pc && rm -rf node_modules && yarn install
```
### 其他
```bash
# 验证 MongoDB / S3 连接
./deploy-test/check-conn.sh