🐛 修复插件安装镜像地址问题:https://zhuanlan.zhihu.com/p/432578145

This commit is contained in:
muwoo 2023-08-18 14:42:55 +08:00
parent 637c1238ae
commit 62bcc345da
3 changed files with 7 additions and 7 deletions

View File

@ -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: '',
};

View File

@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "2.4.3",
"version": "2.4.4",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {

View File

@ -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<void> {
@ -157,14 +157,14 @@ class AdapterHandler {
*/
private async execCommand(cmd: string, modules: string[]): Promise<string> {
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,
});