Skip to content

Commit fe29713

Browse files
authored
fix(ci): manually install nvm-windows instead of Chocolatey (#151)
1 parent 226c5fc commit fe29713

2 files changed

Lines changed: 29 additions & 9 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Guidance for Claude Code when working with the dtvem codebase.
2727
8. **Run validation before commits** - Run `npm run check` (format, lint, test) before committing and pushing
2828
9. **Working an issue** - When working an issue, always create a new branch from an updated main branch
2929
10. **Branch Names** - Always use the conventional commit `type` from the issue title as the first prefix, and the `scope` as the second, then a very short description, example `feat/ci/integration-tests`
30+
11. **Check branch status before pushing** - ALWAYS verify the remote tracking branch still exists before pushing. If a PR was merged/deleted, create a new branch from main instead of trying to push to the old one.
3031
---
3132

3233
## Quick Reference

.github/workflows/integration-test-migrate-node-windows-nvm.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,29 @@ jobs:
4040
- name: "Install nvm-windows"
4141
shell: pwsh
4242
run: |
43-
choco install nvm -y
44-
# Get nvm paths from machine environment (set by Chocolatey installer)
45-
$nvmHome = [System.Environment]::GetEnvironmentVariable("NVM_HOME", "Machine")
46-
if (-not $nvmHome) { $nvmHome = "C:\ProgramData\nvm" }
47-
$nvmSymlink = [System.Environment]::GetEnvironmentVariable("NVM_SYMLINK", "Machine")
48-
if (-not $nvmSymlink) { $nvmSymlink = "C:\Program Files\nodejs" }
43+
# Manual installation of nvm-windows (Chocolatey's async installer doesn't work in CI)
44+
$nvmVersion = "1.2.2"
45+
$nvmHome = "$env:USERPROFILE\AppData\Roaming\nvm"
46+
$nvmSymlink = "$env:USERPROFILE\AppData\Roaming\nodejs"
47+
48+
# Create directories
49+
New-Item -ItemType Directory -Force -Path $nvmHome | Out-Null
50+
New-Item -ItemType Directory -Force -Path $nvmSymlink | Out-Null
51+
52+
# Download nvm-windows noinstall zip
53+
$nvmZip = "$env:TEMP\nvm-noinstall.zip"
54+
Invoke-WebRequest -Uri "https://github.com/coreybutler/nvm-windows/releases/download/$nvmVersion/nvm-noinstall.zip" -OutFile $nvmZip
55+
56+
# Extract to NVM_HOME
57+
Expand-Archive -Path $nvmZip -DestinationPath $nvmHome -Force
58+
59+
# Create settings.txt
60+
$settings = @"
61+
root: $nvmHome
62+
path: $nvmSymlink
63+
proxy: none
64+
"@
65+
$settings | Out-File -FilePath "$nvmHome\settings.txt" -Encoding UTF8
4966
5067
# Export environment variables for subsequent steps
5168
"NVM_HOME=$nvmHome" | Out-File -FilePath $env:GITHUB_ENV -Append
@@ -57,13 +74,15 @@ jobs:
5774
5875
Write-Host "NVM_HOME: $nvmHome"
5976
Write-Host "NVM_SYMLINK: $nvmSymlink"
77+
Write-Host "nvm.exe exists: $(Test-Path "$nvmHome\nvm.exe")"
6078
6179
- name: "Install Node.js 20.18.0 via nvm-windows"
6280
shell: pwsh
6381
run: |
64-
Write-Host "PATH contains NVM_HOME: $($env:PATH -split ';' | Where-Object { $_ -like '*nvm*' })"
65-
nvm install 20.18.0
66-
nvm use 20.18.0
82+
Write-Host "NVM_HOME: $env:NVM_HOME"
83+
Write-Host "nvm.exe path: $env:NVM_HOME\nvm.exe"
84+
& "$env:NVM_HOME\nvm.exe" install 20.18.0
85+
& "$env:NVM_HOME\nvm.exe" use 20.18.0
6786
Write-Host "nvm-windows Node.js version:"
6887
node --version
6988

0 commit comments

Comments
 (0)