-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
46 lines (39 loc) · 1.58 KB
/
Copy pathinstall.ps1
File metadata and controls
46 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Void Dependency Installation Script
# Purpose: Configure Node.js environment and install dependencies
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Void Dependency Installation" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Step 1: Configure fnm environment
Write-Host "[1/3] Configuring fnm environment..." -ForegroundColor Yellow
fnm env --use-on-cd | Out-String | Invoke-Expression
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: fnm environment configuration failed" -ForegroundColor Red
exit 1
}
Write-Host "Success: fnm environment configured" -ForegroundColor Green
Write-Host ""
# Step 2: Switch to specified Node.js version
Write-Host "[2/3] Switching to Node.js v22.18.0..." -ForegroundColor Yellow
fnm use 22.18.0
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Node.js version switch failed" -ForegroundColor Red
exit 1
}
# Verify Node.js version
$nodeVersion = node --version
Write-Host "Success: Current Node.js version: $nodeVersion" -ForegroundColor Green
Write-Host ""
# Step 3: Install dependencies
Write-Host "[3/3] Installing dependencies..." -ForegroundColor Yellow
Write-Host ""
npm install
if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "Error: Dependency installation failed" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host " Installation completed successfully!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green