actions / setup-node

Set up your GitHub Actions workflow with a specific version of node.js
MIT License
3.83k stars 1.26k forks source link

actions/setup-node@v4 can't install from default registry on Windows ARM #1121

Closed hungnv-sr closed 2 days ago

hungnv-sr commented 3 weeks ago

Description: Exception when installing node from this registry (error logs below) https://github.com/actions/node-versions/releases/download/22.6.0-10277432289/node-22.6.0-win32-arm64.7z It still succeeded to fail back to other registry, but it increase build time.

Action version: v4

Platform:

Runner type:

Tools version: npm

Repro steps:
everytime

Expected behavior: It should be installed successfully from the first registry. Being able to choose default registry is also good.

Actual behavior: Logs

Run actions/setup-node@v4
getting latest node version...
getting latest node version...
Attempting to download v22.6.0...
Acquiring 22.6.0 - arm64 from https://github.com/actions/node-versions/releases/download/22.6.0-10277432289/node-22.6.0-win32-arm64.7z
Extracting ...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'C:\a\_temp\1a003888-2ce2-43ea-99a9-559522cd4c[16](https://github.com/...).zip' -DestinationPath 'C:\a\_temp\1c68af65-a37c-4737-98ab-bd771e275182' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\a\_temp\1a003888-2ce2-43ea-99a9-559522cd4c16.zip', 'C:\a\_temp\1c68af65-a37c-4737-98ab-bd771e275182', $true) }"
New-Object : Exception calling ".ctor" with "3" argument(s): "End of Central Directory record could not be found."
At 
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:934 
char:23
+ ... ipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -Ar ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
Falling back to download directly from Node
Acquiring [22](https://github.com/...).6.0 - arm64 from https://nodejs.org/dist/v22.6.0/node-v22.6.0-win-arm64.zip
Extracting ...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'C:\a\_temp\26ab3c44-3d9d-47f2-8d00-01fdd4f92758.zip' -DestinationPath 'C:\a\_temp\0f88f46d-6fa5-4797-96f7-38d5cbce00[24](https://github.com/...)' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\a\_temp\26ab3c44-3d9d-47f2-8d00-01fdd4f92758.zip', 'C:\a\_temp\0f88f46d-6fa5-4797-96f7-38d5cbce0024', $true) }"
Adding to the cache ...
Done
priya-kinthali commented 3 weeks ago

Hello @hungnv-sr 👋, Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

hung-frederic commented 1 week ago

The issue has been fixed with the v22.8.0 release?

priyagupta108 commented 3 days ago

Hi 👋, We've merged PR #1126 into the main branch with a potential fix. Could you please try to use actions/setup-node@main to confirm that it works as expected.

hungnv-sr commented 2 days ago

@priyagupta108 Confirmed. Changing to actions/setup-node@main fixed it. It reduced the step time by almost a minute!