修复前端构建:正确配置 BladeX 私有 npm registry
Some checks failed
continuous-integration/drone/push Build is failing
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:
@@ -3,11 +3,12 @@ FROM node:18-alpine AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# 复制 package 文件
|
||||
# 复制 package 文件和 npm 配置
|
||||
COPY package*.json ./
|
||||
COPY .npmrc ./
|
||||
|
||||
# 安装依赖(使用国内镜像加速)
|
||||
RUN npm install --registry=https://registry.npmmirror.com
|
||||
# 安装依赖(.npmrc 中已配置私有 registry 和认证)
|
||||
RUN npm install
|
||||
|
||||
# 复制源码
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user