From 94400adb110b56844e19fea4436ec27e55a3ca1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=87=E7=AB=8B=E5=BC=BA?= Date: Wed, 3 Dec 2025 16:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BArpm?= =?UTF-8?q?=E6=97=B6=E4=B8=8B=E8=BD=BDElectron=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 寇立强 --- build/scripts/prepare_node_modules_offline.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/scripts/prepare_node_modules_offline.sh b/build/scripts/prepare_node_modules_offline.sh index 4f3d96b6..ebf9eaac 100755 --- a/build/scripts/prepare_node_modules_offline.sh +++ b/build/scripts/prepare_node_modules_offline.sh @@ -11,6 +11,8 @@ cd "$WORKDIR" RELEASE_DIR="$WORKDIR/release" mkdir -p "$RELEASE_DIR" +# 设置npm源为国内源 +npm config set registry https://mirrors.huaweicloud.com/repository/npm/ # 0. 确保已安装 pnpm if ! command -v pnpm >/dev/null 2>&1; then echo "未检测到 pnpm,正在全局安装..." @@ -38,6 +40,8 @@ rsync -a --exclude='.git' --exclude='release' --exclude='node_modules' --exclude cd "$CACHE_DIR" # 3. 安装依赖 +# Setup mirrors for Electron +export ELECTRON_MIRROR="https://mirrors.huaweicloud.com/electron/" pnpm install # 4. 打包 node_modules 及 pnpm-lock.yaml,并分割为4个分块 -- Gitee