From 62bcc345da20ff70980b160888b1c1a5facf60c4 Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Fri, 18 Aug 2023 14:42:55 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E9=95=9C=E5=83=8F=E5=9C=B0=E5=9D=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9Ahttps://zhuanlan.zhihu.com/p/432578145?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/src/views/settings/localhost.vue | 2 +- package.json | 2 +- src/core/plugin-handler/index.ts | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/feature/src/views/settings/localhost.vue b/feature/src/views/settings/localhost.vue index b8b3a74d..21aa6478 100644 --- a/feature/src/views/settings/localhost.vue +++ b/feature/src/views/settings/localhost.vue @@ -80,7 +80,7 @@ const layout = { const resetForm = () => { formState.value = { - register: 'https://registry.npm.taobao.org', + register: 'https://registry.npmmirror.com', database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master', access_token: '', }; diff --git a/package.json b/package.json index 90e9348f..a880c172 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "2.4.3", + "version": "2.4.4", "author": "muwoo <2424880409@qq.com>", "private": true, "scripts": { diff --git a/src/core/plugin-handler/index.ts b/src/core/plugin-handler/index.ts index f74f390f..36874bff 100644 --- a/src/core/plugin-handler/index.ts +++ b/src/core/plugin-handler/index.ts @@ -52,7 +52,7 @@ class AdapterHandler { } catch (e) { // ignore } - this.registry = register || 'https://registry.npm.taobao.org'; + this.registry = register || 'https://registry.npmmirror.com/'; } async upgrade(name: string): Promise { @@ -157,14 +157,14 @@ class AdapterHandler { */ private async execCommand(cmd: string, modules: string[]): Promise { return new Promise((resolve: any, reject: any) => { - let args: string[] = [cmd] + const args: string[] = [cmd] .concat( cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules ) .concat('--color=always') - .concat('--save'); - if (cmd !== 'uninstall') - args = args.concat(`--registry=${this.registry}`); + .concat('--save') + .concat(`--registry=${this.registry}`); + const npm = spawn('npm', args, { cwd: this.baseDir, });