Repository navigation
Description
The NerdFonts module depends on the Admin and Fonts modules. When either dependency is updated beyond the pinned version, Import-Module NerdFonts fails because the #Requires directives use RequiredVersion, which demands an exact match.
This is a blocking issue on PowerShell 7.5+ where module auto-update behavior and side-by-side version loading interact poorly with exact version pins.
Request
What happens
When a user has a newer version of Admin (e.g., 1.1.13) or Fonts (e.g., 1.1.26) installed, importing NerdFonts fails:
Import-Module NerdFonts
Import-Module: The required module 'Admin' is not loaded. Load the module or remove the module from
'RequiredModules' in the file '[...]PowerShell\Modules\NerdFonts\1.0.32\NerdFonts.psd1'.
The user has no way to resolve this without manually installing the exact pinned version of each dependency alongside the newer one.
What is expected
Newer versions of Admin and Fonts should satisfy the dependency constraint. The #Requires directives should specify a minimum version, not an exact version, so that any version equal to or greater than the stated version is accepted.
Environment
- Module version: 1.0.32
- PowerShell: 7.5+ (Core)
- OS: Windows (also affects Linux/macOS)
Regression
This was not previously noticeable because the dependency modules had not been updated beyond the pinned versions. It became a problem once Admin and Fonts released newer versions.
Workaround
Manually install the exact pinned versions of Admin (1.1.6) and Fonts (1.1.21) alongside any newer versions already present. This is fragile and defeats the purpose of semantic versioning.
Acceptance criteria
Import-Module NerdFontssucceeds when the installed versions ofAdminandFontsare equal to or newer than the minimum required versions- The
#Requiresdirectives useModuleVersion(minimum version) instead ofRequiredVersion(exact version) - No change in behavior when the exact pinned versions are installed
Related
- PSModule/Fonts#51 — Same issue in the
Fontsmodule's dependency onAdmin - Handle dependencies better and refactor for reproducibility #57 — Closed PR that included this change among others
Technical decisions
Directive syntax: Change from RequiredVersion to ModuleVersion in the #Requires -Modules hashtable. ModuleVersion specifies the minimum acceptable version, allowing any newer version to satisfy the constraint.
Minimum versions to set: Keep the current version numbers (Admin 1.1.6, Fonts 1.1.21) as the minimum. These are the oldest known-good versions.
Test file: The test file tests/NerdFonts.Tests.ps1 also uses RequiredVersion for Pester (5.7.1). This is a separate concern — Pester version pinning in tests is intentional and common. It should not be changed in this issue.
Implementation plan
Core changes
- In
src/functions/public/Install-NerdFont.ps1, change line 1 from#Requires -Modules @{ ModuleName = 'Fonts'; RequiredVersion = '1.1.21' }to#Requires -Modules @{ ModuleName = 'Fonts'; ModuleVersion = '1.1.21' } - In
src/functions/public/Install-NerdFont.ps1, change line 2 from#Requires -Modules @{ ModuleName = 'Admin'; RequiredVersion = '1.1.6' }to#Requires -Modules @{ ModuleName = 'Admin'; ModuleVersion = '1.1.6' }
Verification
- Verify
Import-Module NerdFontssucceeds with newer versions ofAdminandFontsinstalled - Verify
Import-Module NerdFontsstill succeeds with the exact minimum versions installed - Verify
Install-NerdFontfunctions correctly after the change
Activity
[-]🚀[Feature]: Module dependnecies should use `ModuleVersion` instead of `RequiredVersion` to allow transitive updates[/-][+]🚀[Feature]: Module dependencies should use `ModuleVersion` instead of `RequiredVersion` to allow transitive updates[/+]MariusStorhaug commentedon Apr 17, 2026
Michael Kriese (@viceice)
Jupp, we finally i can repro this and see the issue you are experiencing:
[-]🚀[Feature]: Module dependencies should use `ModuleVersion` instead of `RequiredVersion` to allow transitive updates[/-][+]Replace RequiredVersion with ModuleVersion in #Requires directives[/+]MariusStorhaug commentedon Apr 17, 2026
Restructured the issue description into the standard three-section format.
RequiredVersionpin intests/NerdFonts.Tests.ps1is intentional and out of scopebug,PatchMariusStorhaug commentedon Apr 17, 2026
Hold on, opening a new that is formulated propperly...
MariusStorhaug commentedon Apr 17, 2026
Michael Kriese (@viceice) — Opened #64 to address this properly. Closing this one in favor of the new issue. Thank you for the report!