简体   繁体   English

如何使用nuget.org的OneGet / install-package安装软件包

[英]How do I install a package using OneGet / install-package from nuget.org

I am attempting to install the Microsoft.Experimental.IO library from here : https://www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0 on Windows 10 using Powershell - Install-Package. 我正在尝试使用Powershell-Install-Package从此处安装Microsoft.Experimental.IO库: https : //www.nuget.org/packages/Microsoft.Experimental.IO/1.0.0在Windows 10上。

I have added the nuget.org repo and when I use the command "find-package -contains experimental " Powershell finds the package, but when i try to install it, I receive the following error. 我已经加入了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

How can I overcome this issue and install the package? 如何解决此问题并安装软件包?

Well I fixed this, by using the following command : install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\\Dev\\Lib\\Microsoft.Experimental.IO" 好吧,我使用以下命令修复了此问题: install-package -ProviderName nuget -Name Microsoft.Experimental.IO -Destination "C:\\Dev\\Lib\\Microsoft.Experimental.IO"

Which isnt the most intuitive, I've never had to use a destination field when using any other package manager in the past. 哪一种不是最直观的,所以在过去使用任何其他程序包管理器时,我从不需要使用目标字段。 I thought the whole point of a package manager was to standardise on paths and locations etc... 我以为包管理器的全部目的是标准化路径和位置等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为OneGet安装软件包创建可执行软件包? - How can I create executable package for OneGet Install-Package? Nuget的Powershell安装包 - Powershell Install-Package from Nuget 如何使用 Install-Package 为 PowerShell 安装 MongoDB 驱动程序? - How do I install MongoDB driver for PowerShell using Install-Package? “nuget install”,“Install-Package”和“choco install”有什么区别? - What is the difference betwee “nuget install” , “Install-Package” and “choco install”? Install-Package&NuGet Package安装位置 - 安装到哪里? - Install-Package & NuGet Package install location - where installed to? 如何在正常的PowerShell会话中(不在Visual Studio中)运行Nuget PowerShell cmdlet Install-Package? - How can I run Nuget PowerShell cmdlet Install-Package in normal PowerShell session (not inside Visual Studio)? 如何在PowerShell中使用install-package cmdlet安装多个包? - How to install multiple packages using install-package cmdlet in powershell? 运行 install-package 而不提示安装 nuget - run install-package without it prompting to install nuget Find-Package 有效,但 Install-Package 在 powershell 中使用 Chocolatey 仅显示 nuget 错误 - Find-Package works but Install-Package shows only nuget error using chocolatey in powershell 使用Install-Package时跳过确认? - Skip confirmation while using Install-Package?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM