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

Cannot install powershell modules on CentOS 7 #192

Open
@adaviel

Description

@adaviel

I have powershell-6.0.0_beta.9-1.rhel.7.x86_64 on CentOS 7.4.1708

PS /root> Install-Module -Name psCheckPoint -Scope CurrentUser -Force
... .. Installing package 'psCheckPoint' Downloaded 0.00MB out of 0.63MB Installing package 'psCheckPoint' Downloaded 0.31MB out of 0.63MB
[ooooooooo ] Installing package 'psCheckPoint' .. . Unzipping [ooooo ]

S /root> Import-Module psCheckPoint Import-Module
The specified module 'psCheckPoint' was not loaded because no valid module file was found in any module
Noting created in .local/share/powershell/Modules/

Activity

bmanikm

bmanikm commented on Nov 7, 2017

@bmanikm
Contributor

@adaviel Can you get the debug output of following command from your environment?

Install-Module -Name psCheckPoint -Scope CurrentUser -Force -Verbose -Debug
adaviel

adaviel commented on Nov 7, 2017

@adaviel
Author

See attached file

pwsh.debug.log

bmanikm

bmanikm commented on Nov 8, 2017

@bmanikm
Contributor

@adaviel Thanks for providing the debug output, unfortunately this debug output is not helping us in determining the root cause of the issue.

Is this issue happening only for psCheckPoint module?
Are you able to install any other module on your machine?
Do you know whether the psCheckPoint module is supported on PWSH?

Please use Save-Module as a workaround until we understand the root cause of this issue on CentOS.

Save-Module -Name psCheckPoint -Path '/root/.local/share/powershell/Modules' -Verbose

If possible, please provide the output for following commands.

Save-Module -Name psCheckPoint -Path /tmp/ -Verbose
dir /tmp/psCheckPoint -Recurse
Test-ModuleManifest -Path /tmp/psCheckPoint/0.7.8/psCheckPoint.psd1 -verbose -debug
adaviel

adaviel commented on Nov 8, 2017

@adaviel
Author

I can not install any modules. I was told I needed to install MSOnline, which is why I was trying, but that turned out to be a different bug and I did not really need it.

I'm not that familiar with powershell; I do not know whether psCheckPoint is supported. A responder on a different tracker told me to try that, then said I should re-post the issue in this tracker.

See attached log. Save-Module creates the directory tree, but does not actually populate it.
I assume if I could download a module with wget I could install it, but it's not obvious to me how I could do that.
debug2.log

bmanikm

bmanikm commented on Nov 9, 2017

@bmanikm
Contributor

It looks like NuGet provider is unable to download the file on your machine.

Again for further investigation, please provide the output of below commands.

Install-Package -Provider NuGet -Source https://www.powershellgallery.com/api/v2 -Name psCheckPoint -Destination '/tmp/' -Verbose -debug -ExcludeVersion
dir /tmp/psCheckPoint -Recurse
Test-ModuleManifest -Path /tmp/psCheckPoint/psCheckPoint.psd1 -verbose
Import-Module /tmp/psCheckPoint/psCheckPoint.psd1 -Verbose

If above commands work properly, please use the below command as a workaround.

Install-Package -Provider NuGet -Source https://www.powershellgallery.com/api/v2 -Name psCheckPoint -Destination '/root/.local/share/powershell/Modules' -Verbose -debug -ExcludeVersion
adaviel

adaviel commented on Nov 9, 2017

@adaviel
Author

debug3.log

It seems I do now have
/tmp/psCheckPoint.0.7.8/psCheckPoint.psd1

so that
Test-ModuleManifest -Path /tmp/psCheckPoint.0.7.8/psCheckPoint.psd1
and
Import-Module /tmp/psCheckPoint.0.7.8/psCheckPoint.psd1
work

debug4.log

bmanikm

bmanikm commented on Nov 9, 2017

@bmanikm
Contributor

@adaviel Thanks for the logs.
From debug3.log and debug4.log, it is clear that it is a NuGet provider issue where -ExcludeVersion is not honored.

@brywang-msft Could you please take a look at this issue in NuGet provider?

Earlier reported issue --> PowerShell/PowerShell#3986

sanyer

sanyer commented on Jul 9, 2018

@sanyer

I'm experiencing the same issue on Amazon Linux 2 (which is RHEL7/CentOS 7 compatible).
Installing module as was suggested in this comment https://github.com/PowerShell/PowerShellGet/issues/192#issuecomment-343002826 helped.
But, module was installed in flat directory structure, so no child folder with version.
After I created folder with version and moved files there, become was able to import the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Cannot install powershell modules on CentOS 7 · Issue #192 · PowerShell/PowerShellGetv2