diff --git a/feature/src/views/settings/localhost.vue b/feature/src/views/settings/localhost.vue index b8b3a74..21aa647 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 90e9348..a880c17 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 f74f390..36874bf 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, });