question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error installing Install-Module

See original GitHub issue

I’m getting an error message running Install-Module to install my Emojis PowerShell module from the PowerShell Gallery. It seems that the -alpha is screwing up the semantic version checking.

  • Ubuntu 16.04 LTS Xenial base image (Dockerized)
  • PowerShell 6.0.0-alpha

PackageManagement\Install-Package : Could not compare “6.0.0-alpha” to “5.0”. Error: "Cannot convert value “5.0” to typ Installing package ‘Emojis’ e “System.Management.Automation.SemanticVersion”. Error: “Cannot process argument because the value of argument “version” is not valid. Change the value of the “version” argument and run the operation again.”"oooooooooooooooooooooooooooo] At /opt/microsoft/powershell/6.0.0-alpha.8/Modules/PowerShellGet/PSModule.psm1:1706 char:21

  • … $null = PackageManagement\Install-Package @PSBoundParameters
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Microsoft.Power…InstallPackage:InstallPackage) [Install-Package], Exception
    • FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

image

Cheers, Trevor Sullivan Microsoft MVP: Cloud & Data Center Management https://trevorsullivan.net https://twitter.com/pcgeek86

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bmanikmcommented, Aug 20, 2016

@pcgeek86

Please use one of the following options to install the modules

Option 1: Replace the PSModule.psm1 file under PowerShellGet module base with the updated file from master branch (https://github.com/PowerShell/PowerShell).

Install-Module error got resolved by adding a workaround in PowerShellGet module.
Please replace the PSModule.psm1 file under PowerShellGet module base with https://github.com/PowerShell/PowerShell/blob/master/src/Modules/Shared/PowerShellGet/PSModule.psm1.
For more details --> #1927

Option 2: Get the latest CI build

https://ci.appveyor.com/project/PowerShell/powershell/build/artifacts
    OR
https://travis-ci.org/PowerShell/PowerShell/builds/ 

Option 3: Use NuGet provider to install the required module to the target location.

Install-Package -Name $ModuleName -Source https://www.powershellgallery.com/api/v2/ -ProviderName NuGet -ExcludeVersion -Destination $YourTargetLocation
0reactions
bmanikmcommented, Aug 22, 2016

@pcgeek86 Currently CI builds are not configured for generating the Ubuntu 16 package. Could you please open an issue for it?

@halr9000 Yes, could you please add this to known issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Powershell won't install almost any module using ...
1 won't install almost any module automatically using install-module whereas manually installation does work. First, when I run install-module , ...
Read more >
Cannot install powershell modules - Microsoft Q&A
My problem is that I am not able to install modules to my powershell console. Example: Install-module -Name AzureAD.
Read more >
The term 'Install-Module' is not recognized as the name of ...
Install -Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the ......
Read more >
Unable to download from URI – powershell install module
The issue occurs when PowerShell tries to connect to the NuGet repository using legacy TLS/SSL protocols instead of the current TLS 1.2. Check ......
Read more >
Unable to Download from URI, PowerShell Install-Module ...
To easily and quickly resolve the Unable to Download from URI, PowerShell Install-Module Error on your Windows 11/10 system, you can first check ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found