尝试将PowerShell模块发布到本地存储库时出现“Dotnet无法打包”错误

3

我正在使用MacOS 10.15,并且有一个PSRabbitMq PowerShell模块的克隆版本。我尝试将其发布到我创建的本地存储库中:

Register-PSRepository -Name TestPSRepo -SourceLocation '/tmp/powershell_test_repository' -InstallationPolicy Trusted
Publish-Module -Path '<path_to_module>/PSRabbitMq' -Repository TestPSRepo -NuGetApiKey 'test' -Verbose

遇到此错误:

Publish-PSArtifactUtility : Failed to generate the compressed file for module '/usr/local/bin/dotnet failed to pack: error
'.
At /Users/my_user/.local/share/powershell/Modules/PowerShellGet/2.2.1/PSModule.psm1:10944 char:17
+ ...             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility

我已经安装了dotnet-runtime-3.0.0-osx,有人知道这个错误是什么意思吗?

谢谢!

1个回答

4

我明白了。

我安装的是 dotnet 而不是 dotnet-sdk

brew cask uninstall dotnet
brew cask install dotnet-sdk

解决了我的问题。

希望它能有用于其他人的某个时候。


对我很有用:)在Windows上也一样。我更新了dotnet运行时和sdk,然后发布工作正常。 - Jared Beach

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接