修复前端构建:正确配置 BladeX 私有 npm registry
Some checks failed
continuous-integration/drone/push Build is failing

问题:
- Dockerfile 中 npm install 时未复制 .npmrc 文件
- 使用 --registry 参数覆盖了 .npmrc 中的私有 registry 配置
- 导致无法下载 @saber scope 的私有包,报 E401 认证错误

解决方案:
- Dockerfile: 在 npm install 前复制 .npmrc 文件
- Dockerfile: 移除 --registry 参数,使用 .npmrc 中的配置
- .drone.yml: 同样移除 --registry 参数

现在 npm 会正确使用:
- @saber 包 -> https://center.javablade.com (私有 registry)
- 其他包 -> npm 默认源

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
n72595987@gmail.com
2025-11-29 17:57:25 +08:00
parent 1d8d60ccaa
commit 36116e0973
2 changed files with 5 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ steps:
image: node:18-alpine
commands:
- echo "开始安装 npm 依赖..."
- npm install --registry=https://registry.npmmirror.com
- npm install
- echo "✅ 依赖安装完成"
# 步骤2构建生产版本