Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Install-Package fails on package with only prerelease versions #695

Open
3 tasks done
robunoki-microsoft opened this issue Mar 9, 2023 · 1 comment
Open
3 tasks done

Comments

@robunoki-microsoft
Copy link

robunoki-microsoft commented Mar 9, 2023

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

D:\ Find-Package Azure.Communication.Email -Source nuget.org -AllowPrereleaseVersions -AllVersions

Name                           Version          Source           Summary
----                           -------          ------           -------
Azure.Communication.Email      1.0.0-beta.2     nuget.org        This client library enables working with the Microsoft Azure Communication Ema…
Azure.Communication.Email      1.0.0-beta.1     nuget.org        This client library enables working with the Microsoft Azure Communication Ema…

D:\ Install-Package  -AllowPrereleaseVersions -Name "Azure.Communication.Email"
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.

D:\ Install-Package  -AllowPrereleaseVersions -Name Azure.Communication.Email
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.

D:\ Install-Package  -AllowPrereleaseVersions -AllVersions -Name Azure.Communication.Email
WARNING: 'Azure.Communication.Email' matched package 'Azure.Communication.Email/1.0.0-beta.2' from provider: 'NuGet', source 'nuget.org'.
WARNING: 'Azure.Communication.Email' matched package 'Azure.Communication.Email/1.0.0-beta.1' from provider: 'NuGet', source 'nuget.org'.
Install-Package: Unable to install, multiple packages matched 'Azure.Communication.Email'. Please specify an exact -Name and -RequiredVersion.

D:\ Install-Package  -AllowPrereleaseVersions -AllVersions -Name Azure.Communication.Email -RequiredVersion "1.0.0-beta.2"
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.```


### Expected behavior

```console
One of the Install-Package commands above should succeed.

Actual behavior

All of the Install-Package commands fail.

Error details

D:\ Find-Package Azure.Communication.Email -Source nuget.org -AllowPrereleaseVersions -AllVersions

Name                           Version          Source           Summary
----                           -------          ------           -------
Azure.Communication.Email      1.0.0-beta.2     nuget.org        This client library enables working with the Microsoft Azure Communication Ema…
Azure.Communication.Email      1.0.0-beta.1     nuget.org        This client library enables working with the Microsoft Azure Communication Ema…

D:\ Install-Package  -AllowPrereleaseVersions -Name "Azure.Communication.Email"
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.

D:\ Install-Package  -AllowPrereleaseVersions -Name Azure.Communication.Email
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.

D:\ Install-Package  -AllowPrereleaseVersions -AllVersions -Name Azure.Communication.Email
WARNING: 'Azure.Communication.Email' matched package 'Azure.Communication.Email/1.0.0-beta.2' from provider: 'NuGet', source 'nuget.org'.
WARNING: 'Azure.Communication.Email' matched package 'Azure.Communication.Email/1.0.0-beta.1' from provider: 'NuGet', source 'nuget.org'.
Install-Package: Unable to install, multiple packages matched 'Azure.Communication.Email'. Please specify an exact -Name and -RequiredVersion.

D:\ Install-Package  -AllowPrereleaseVersions -AllVersions -Name Azure.Communication.Email -RequiredVersion "1.0.0-beta.2"
Install-Package: No match was found for the specified search criteria and package name 'Azure.Communication.Email'. Try Get-PackageSource to see all available registered package sources.

Environment data

D:\ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

D:\ Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            True       https://api.nuget.org/v3/index.json
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2

D:\ Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
NuGet                    3.0.0.1          Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrerelease…
PowerShellGet            2.2.5.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate…

Version

7.3.3

Visuals

No response

@LaurentDardenne
Copy link

The version number '1.0.0-beta.2' is a valid semver 2.0 but an invalid powshellget version.
From : https://learn.microsoft.com/en-us/powershell/gallery/concepts/module-prerelease-support?view=powershellget-2.x

Only SemVer v1.0.0 prerelease strings are supported at this time. Prerelease string must not contain either period or + [.+], which are allowed in SemVer 2.0.

https://github.com/PowerShell/PowerShellGetv2/blob/master/src/PowerShellGet/private/functions/ValidateAndGet-VersionPrereleaseStrings.ps1#L36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants