-
Notifications
You must be signed in to change notification settings - Fork 138
Failed to generate the compressed file for module 'Cannot index into a null array'. #606
Comments
Same problem! |
Hi, Best regards |
Same Problem here under windows. no solution, i cant publish |
Same Problem here under windows too. |
Cause is language maybe... This script will search standard-out of dotnet command with text message. [src\PowerShellGet\private\functions\New-NugetPackage.ps1] My computer run in Japanese, dotnet command output is Japanese. So It's not match! $matches is null. --> 'Cannot index into a null array.' |
I use Italian. What is the solution? Best regards |
I downgraded to an older version and replaced the nuget.exe with an actual version. this worked for me. |
Wich version? Best regards |
Sorry for the Late answer, i was not at work for the last days. I downgraded PowerShellGet To 1.0.0.1 After the first usage of Publish-Module there will be an old nuget.exe at C:\Users<UserName>\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\ I replaced the nuget.exe with with version 5.6.0.6591 Then Publish-Module works fine for me. Maybe you also need to set the correct TLS Version in the PowerShell Console with [PS]> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
Having the same problem, seemingly out of nowhere. I used this blog to solve my problem: https://sqldbawithabeard.com/2019/11/26/fixing-the-failed-to-generate-the-compressed-file-for-module-cprogram-filesdotnetdotnet-exe-error-when-deploying-to-the-powershell-gallery-using-azure-devops/ |
Same problem here under windows |
Hello same problem here. for me the problem was located in the had to change:
to
because i'm working on a french version of windows. |
I ran the following code in PowerShell to fix the problem. "$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe" |
Where-Object { !(Test-Path -LiteralPath $_ -PathType Leaf) } |
ForEach-Object {
(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', $_)
} |
This was also the issue on my German system. |
Did someone tested the new v3 ??? I asked on twitter but no one answered... :( |
I would love to know if using v3 helps to resolve this issue (https://www.powershellgallery.com/packages/PowerShellGet/3.0.11-beta). If not we can't proceed to make bug fixes and updates there. |
How do I install PowerShellGet 3.0.11-beta? Even after putting it into my modules folder and importing it, whenever I run Also tried
|
Please run the following steps:
Let us know if this works for you. This is specifically for publishing to the PowerShell Gallery. |
Thanks, I can confirm that I could successfully publish using 3.0.11-beta and the command you suggested. |
Hy chausner, thanks for you´re answer. I also have a German windows with the same error. To what text do i need to change it since I don´t know how to capture the $stdout variable |
I also encountered the same problem in a Japanese Windows 11 machine. $env:DOTNET_CLI_UI_LANGUAGE="en_US" |
@YIsoda Your solution is by far the easiest and most intuitive! I really hate it that this issue is present even after 3 years... |
@YIsoda Problem solved the same way on my Win11 German. Thanks a lot. |
All methods except downgrade nuget to 5.0.2 doesn't work :( Any news? |
I fix it by installing Dotnet 7 and running @YIsoda command - Thanks! |
For those people still having the problem, there is an environment variable named NUGET_CLI_LANGUAGE, similar to DOTNET_CLI_UILANGUAGE, you have to set it to "en-us" in order to New-NugetPackage.ps1 to work. This was tested in Powershell version 2.2.5. See reference: NuGet/Home#12181 |
I am trying to publish a module from a MacOS.
@SydneyhSmith tagging you hopping you can help resolve this one quickly.
Steps to reproduce
Expected behavior
Actual behavior
Environment data
I went and debugged a little bit setting a breakpoint here and there. I noticed that the splatted variable was missing some values that were actually set in my psd1 file (Tags and ProjectURI for what I could tell).
I am currently blocked as I need to publish public this module, but I have only this way to do so (there is not a way of doing it via the website).
The text was updated successfully, but these errors were encountered: