From 8b44abe720dd4bd2c8ebea10c997f64afea92a72 Mon Sep 17 00:00:00 2001 From: Ater_NilTor Date: Mon, 27 Nov 2023 11:26:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwindows=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=94=99=E8=AF=AF=20(#715)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: KaiyiWing --- scripts/install.ps1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 7af57168..f4fbd2fe 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -11,8 +11,6 @@ function Test-CommandInstalled([string]$CommandName) { $location = Get-Location -$hasWinget = false; - # 检测Node命令是否存在 if (!(Test-CommandInstalled node)) { Write-Host "未检测到nodejs环境,尝试使用winget安装..." @@ -21,12 +19,11 @@ if (!(Test-CommandInstalled node)) { Write-Host "未检测到winget,无法完成安装,请检测系统版本,或尝试安装winget:https://www.microsoft.com/p/app-installer/9nblggh4nns1#activetab=pivot:overviewtab" } else { - $hasWinget = true; - winget install OpenJS.Nodejs --slient + winget install OpenJS.Nodejs --silent Write-Host "nodejs 安装完成" } -} -if ($hasWinget) { +}else{ + Write-Host "已安装nodejs!" Set-Location .. Write-Host "开始安装依赖..." yarn install --registry=https://registry.npm.taobao.org @@ -36,8 +33,6 @@ if ($hasWinget) { Start-Sleep 4 Start-Process http://localhost:5173/ } | Out-Null - npm run start Set-Location $location - }