PowerShellBuild icon indicating copy to clipboard operation
PowerShellBuild copied to clipboard

Powershellget error when pushing module to private repo

Open FLeven opened this issue 3 years ago • 2 comments

I need to publish the module to a private nexus repo and get an error:

Expected Behavior

save-module publish-module

Current Behavior

Publish-Module

The specified RequiredModules entry 'BuildHelpers' in the module
manifest 'C:\Users\jenkins\AppData\Local\Temp\1443179751\PowerShellBuild\PowerShellBuild.psd1' is invalid. Try again
after updating this entry with valid values.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:10817 char:27

Workaround

Remove the required modules from the psd1 file

RequiredModules = @( @{ModuleName = 'BuildHelpers'; ModuleVersion = '2.0.16'} @{ModuleName = 'Pester'; ModuleVersion = '5.3.1'} @{ModuleName = 'platyPS'; ModuleVersion = '0.14.2'} @{ModuleName = 'psake'; ModuleVersion = '4.9.0'} )

Steps to Reproduce (for bugs)

save-module publish-module

Your Environment

Jenkins-agent running PowerShell 5.1 in Windows Docker Server Core container

FLeven avatar Feb 14 '22 13:02 FLeven

I don't think the solution is a valid one. The issue is publishing to your Nexus and I feel you should concentrate on resolving that issue rather than removing the required module from the manifest which would affect everybody.

pauby avatar Feb 14 '22 14:02 pauby

Of cause, I only offered a dirty workaround for the problem. I an not sure if it is exclusively related to nexus, as powershellget is throwing the error.

FLeven avatar Feb 15 '22 08:02 FLeven

@FLeven This is likely because BuildHelpers is not published to your Nexus repository. Publish-Module will verify that any modules listed in RequiredModules are available in the repository you're deploying to.

devblackops avatar Sep 16 '22 07:09 devblackops