OneGet / oneget

PackageManagement (aka OneGet) is a package manager for Windows
MIT License
2.38k stars 190 forks source link

Find-Package founds the package but Install package fauls to find ind install it #186

Closed eosfor closed 8 years ago

eosfor commented 8 years ago

PS X:> $PSVersionTable

Name Value


PSVersion 5.0.10586.122 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.10586.122 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

PS X:> Get-PackageProvider

Name Version DynamicOptions


msi 3.0.0.0 AdditionalArguments msu 3.0.0.0 NuGet 2.8.5.127 Destination, SkipDependencies, ContinueOnFailure, ExcludeVersion, PackageSaveMode, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, InstallUpdate, PackageManagementProvider, Type, Filter, Tag, Includes, DscResource, Command, PackageManagementProvider, Type, PackageManagementProv... Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent

PS X:> Find-Package SharpZipLib -Verbose VERBOSE: Using the provider 'Programs' for searching packages. VERBOSE: Using the provider 'msu' for searching packages. VERBOSE: Using the provider 'msi' for searching packages. VERBOSE: Using the provider 'NuGet' for searching packages. VERBOSE: Using the provider 'PowerShellGet' for searching packages. 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'.

Name Version Source Summary


SharpZipLib 0.86.0 nuget.org #ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an as...

PS X:> Install-Package SharpZipLib -Verbose VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination' VERBOSE: Using the provider 'Programs' for searching packages. VERBOSE: Using the provider 'msu' for searching packages. VERBOSE: Using the provider 'msi' for searching packages. VERBOSE: Using the provider 'PowerShellGet' for searching packages. 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 'SharpZipLib'. At line:1 char:1

PS X:> Install-Package SharpZipLib -Verbose -Debug DEBUG: 00:00:00.0000003 Calling 'Programs::GetDynamicOptions' 'Provider'

Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A DEBUG: 00:00:00.0018612 Calling 'Programs::GetDynamicOptions' 'Source' DEBUG: 00:00:00.0055387 Calling 'Programs::GetDynamicOptions' 'Package' DEBUG: 00:00:00.0074595 Calling 'Programs::GetDynamicOptions' 'Install' DEBUG: 00:00:00.0106797 Calling 'msu::GetDynamicOptions' 'Provider' DEBUG: 00:00:00.0124623 Calling 'msu::GetDynamicOptions' 'Source' DEBUG: 00:00:00.0155138 Calling 'msu::GetDynamicOptions' 'Package' DEBUG: 00:00:00.0174018 Calling 'msu::GetDynamicOptions' 'Install' DEBUG: 00:00:00.0205530 Calling 'msi::GetDynamicOptions' 'Provider' DEBUG: 00:00:00.0229628 Calling 'msi::GetDynamicOptions' 'Source' DEBUG: 00:00:00.0259526 Calling 'msi::GetDynamicOptions' 'Package' DEBUG: 00:00:00.0278192 Calling 'msi::GetDynamicOptions' 'Install' DEBUG: 00:00:00.0308746 Calling 'NuGet::GetDynamicOptions' 'Provider' DEBUG: 00:00:00.0328421 Calling 'NuGet::GetDynamicOptions' 'Source' DEBUG: 00:00:00.0356704 Calling 'NuGet::GetDynamicOptions' 'Package' DEBUG: 00:00:00.0379748 Calling 'NuGet::GetDynamicOptions' 'Install' DEBUG: 00:00:00.0411534 Calling New() : MethodName = 'GetDynamicOptions' DEBUG: 00:00:00.0411709 Verbose: True DEBUG: 00:00:00.0411808 Debug: True DEBUG: 00:00:00.0411898 Name: SharpZipLib DEBUG: 00:00:00.0418767 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1 DEBUG: 00:00:00.0424000 In PowerShellGet Provider - 'Get-DynamicOptions'. DEBUG: 00:00:00.0436427 Done calling powershell «Get-DynamicOptions» «PSModule» DEBUG: 00:00:00.0456877 Calling New() : MethodName = 'GetDynamicOptions' DEBUG: 00:00:00.0457052 Verbose: True DEBUG: 00:00:00.0457145 Debug: True DEBUG: 00:00:00.0457232 Name: SharpZipLib DEBUG: 00:00:00.0462342 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1 DEBUG: 00:00:00.0467072 In PowerShellGet Provider - 'Get-DynamicOptions'. DEBUG: 00:00:00.0509257 Done calling powershell «Get-DynamicOptions» «PSModule» DEBUG: 00:00:00.0533853 Calling New() : MethodName = 'GetDynamicOptions' DEBUG: 00:00:00.0534054 Verbose: True DEBUG: 00:00:00.0534154 Debug: True DEBUG: 00:00:00.0534247 Name: SharpZipLib DEBUG: 00:00:00.0542167 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1 DEBUG: 00:00:00.0546295 In PowerShellGet Provider - 'Get-DynamicOptions'. DEBUG: 00:00:00.0569127 Done calling powershell «Get-DynamicOptions» «PSModule» DEBUG: 00:00:00.0600706 Calling New() : MethodName = 'GetDynamicOptions' DEBUG: 00:00:00.0600902 Verbose: True DEBUG: 00:00:00.0600998 Debug: True DEBUG: 00:00:00.0601091 Name: SharpZipLib DEBUG: 00:00:00.0606327 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1 DEBUG: 00:00:00.0610753 In PowerShellGet Provider - 'Get-DynamicOptions'. DEBUG: 00:00:00.0626744 Done calling powershell «Get-DynamicOptions» «PSModule» VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination' DEBUG: 00:00:02.2287429 Calling SearchForPackages. Name='SharpZipLib' VERBOSE: Using the provider 'Programs' for searching packages. DEBUG: 00:00:02.2295545 PackageProvider::FindPackage with name SharpZipLib VERBOSE: Using the provider 'msu' for searching packages. DEBUG: 00:00:02.2314040 PackageProvider::FindPackage with name SharpZipLib VERBOSE: Using the provider 'msi' for searching packages. DEBUG: 00:00:02.2429086 PackageProvider::FindPackage with name SharpZipLib VERBOSE: Using the provider 'PowerShellGet' for searching packages. DEBUG: 00:00:02.2514485 PackageProvider::FindPackage with name SharpZipLib DEBUG: 00:00:02.2520031 Calling SearchForPackages After Select 4 DEBUG: 00:00:02.2537092 Calling New() : MethodName = 'FindPackage' DEBUG: 00:00:02.2537321 Verbose: True DEBUG: 00:00:02.2537565 Debug: True DEBUG: 00:00:02.2537703 Name: SharpZipLib DEBUG: 00:00:02.2631709 INVOKING PowerShell Fn Find-Package with args System.String[], , , that has length 4 DEBUG: 00:00:02.2655621 In PowerShellGet Provider - 'Find-Package'. DEBUG: 00:00:02.2662658 OPTION: Verbose => True DEBUG: 00:00:02.2664279 OPTION: Debug => True DEBUG: 00:00:02.2665963 OPTION: Name => SharpZipLib 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'. DEBUG: 00:00:02.2710523 PackageProvider::FindPackage with name SharpZipLib DEBUG: 00:00:02.2788300 Calling 'NuGet::FindPackage' 'SharpZipLib','','','','0' DEBUG: 00:00:02.2788872 Iterating DEBUG: 00:00:02.8175792 Done Iterating DEBUG: 00:00:02.8176816 Iterating DEBUG: 00:00:02.8190469 Searching repository 'https://www.powershellgallery.com/api/v2/' for 'SharpZipLib' DEBUG: 00:00:03.0042960 Done Iterating DEBUG: 00:00:03.0043960 Finished 'NuGet::FindPackage' 'SharpZipLib','','','','0' DEBUG: 00:00:03.0048569 PowerShell Script 'PSModule' Function 'Find-Package' returns null. DEBUG: 00:00:03.0056899 Done calling powershell «Find-Package» «PSModule» DEBUG: 00:00:03.0250099 unmatched package name='SharpZipLib'

Confirm No match was found for the specified search criteria and package name 'SharpZipLib'. [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A Install-Package : No match was found for the specified search criteria and package name 'SharpZipLib'. At line:1 char:1

jianyunt commented 8 years ago

@eosfor, please try out the following:

  1. Install-Package SharpZipLib -Verbose -Destination c:\test or
  2. Install-PackageProvider -Name nuget -force Install-Package SharpZipLib -Verbose

Here is what's happening under the hood. When you type "install-package SharpZipLib", OneGet is asking all the providers who can handle this package. It ends up the PowerShellGet provider is trying to find the package 'SharpZipLib' in the http://www.powershellgallery.com. As you know SharpZipLib does not exist in the PowerShellGallery.com. That's why you get package not found error. Then you may ask why the NuGet provider does not take in place here. This is because the NuGet provider requires -destination, you may find: VERBOSE: Skipping package provider provider 'NuGet'-- missing required option 'Destination'

In the later version of the NuGet provider, we supported the default path (not require -destination): $env:programfiles\NuGet\Packages. You can update the NuGet provider by running 'Install-PackageProvider -Name nuget -force' or manually delete the NuGet folder under 'C:\Program Files\PackageManagement\ProviderAssemblies\'.

eosfor commented 8 years ago

I'll try and let you know, thank you