From dd4763a4a7cdf08bcdc3a7d1c6b9f5d403da2d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B9=8F?= Date: Sat, 10 Oct 2026 11:49:42 +0800 Subject: [PATCH] Use npm mirror for frontend dependencies --- deploy_tool/deployer.py | 12 +++++++++++- tests/test_deployer.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/deploy_tool/deployer.py b/deploy_tool/deployer.py index 843368b..f2342c2 100644 --- a/deploy_tool/deployer.py +++ b/deploy_tool/deployer.py @@ -110,7 +110,17 @@ def build_deployment_plan(scan: ScanResult, config: DeploymentConfig) -> list[De steps.append( DeploymentStep( f"安装{display_name}依赖", - [npm_command, "install", "--no-audit", "--no-fund", "--progress=false"], + [ + npm_command, + "install", + "--registry=https://registry.npmmirror.com", + "--strict-ssl=false", + "--legacy-peer-deps", + "--no-audit", + "--no-fund", + "--progress=false", + "--loglevel=verbose", + ], frontend.path, f"安装{display_name} package.json 中的依赖", kind="frontend_install", diff --git a/tests/test_deployer.py b/tests/test_deployer.py index 043b445..10a8c56 100644 --- a/tests/test_deployer.py +++ b/tests/test_deployer.py @@ -992,7 +992,17 @@ class DeployerTests(unittest.TestCase): ) self.assertEqual( plan[0].command, - [npm, "install", "--no-audit", "--no-fund", "--progress=false"], + [ + npm, + "install", + "--registry=https://registry.npmmirror.com", + "--strict-ssl=false", + "--legacy-peer-deps", + "--no-audit", + "--no-fund", + "--progress=false", + "--loglevel=verbose", + ], ) self.assertEqual(plan[1].command[1:3], ["run", "serve"])