[英]How do I install a package using OneGet / install-package from nuget.org
我正在嘗試使用Powershell-Install-Package從此處安裝Microsoft.Experimental.IO庫: https : //www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0在Windows 10上。
我已經加入了nuget.org回購,當我使用命令“找到包-包含實驗 ” Powershell的發現包,但是當我嘗試安裝它,我收到以下錯誤。
install-package Microsoft.Experimental.IO -verbose
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
install-package : No match was found for the specified search criteria and package name 'Microsoft.Experimental.IO'.
At line:1 char:1
+ install-package Microsoft.Experimental.IO -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
如何解決此問題並安裝軟件包?
好吧,我使用以下命令修復了此問題: install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\\Dev\\Lib\\Microsoft.Experimental.IO"
哪一種不是最直觀的,所以在過去使用任何其他程序包管理器時,我從不需要使用目標字段。 我以為包管理器的全部目的是標准化路徑和位置等。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.