You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 NerdFonts succeeds when the installed versions of Admin and Fonts are equal to or newer than the minimum required versions
The #Requires directives use ModuleVersion (minimum version) instead of RequiredVersion (exact version)
No change in behavior when the exact pinned versions are installed
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: Bump the floor to the latest published versions of each dependency at the time of the fix, rather than carrying forward stale pins:
Both modules follow SemVer, so any future minor/patch release remains compatible.
Note
Why ModuleVersion (minimum) instead of RequiredVersion (exact pin):
Per the official PowerShell module manifest documentation, version constraints in both RequiredModules and #Requires -Modules support three strategies:
Key
Behavior
Risk
RequiredVersion
Exact pin — only that version satisfies
Causes "dependency hell" when any newer version is installed
ModuleVersion
Minimum floor — any version ≥ value satisfies
Recommended default. Works as long as the dependency honors SemVer
ModuleVersion + MaximumVersion
Major-pinned range — allows minor/patch, blocks next major
Best protection when a future major version may introduce breaking changes
Exact pinning (RequiredVersion) should be avoided for published modules that follow SemVer. It is the root cause of this bug.
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.
Future consideration: migrate from #Requires to manifest RequiredModules
The #Requires -Modules directive on individual function files is evaluated at script scope and does not cause Install-Module / Install-PSResource to auto-install dependencies. It only asserts presence at load time.
Is resolved and auto-installed by the PowerShell Gallery when a user runs Install-Module NerdFonts
Provides a single, authoritative declaration of dependencies (no duplication across files)
Supports the same ModuleVersion / MaximumVersion / RequiredVersion syntax
Moving the Admin and Fonts dependency declarations from per-file #Requires directives to RequiredModules in the module manifest would eliminate duplication and give users automatic dependency resolution. This is tracked as a follow-up, not part of this fix.
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.26' }
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.13' }
Verification
Verify Import-Module NerdFonts succeeds with newer versions of Admin and Fonts installed
Verify Import-Module NerdFonts still succeeds with the exact minimum versions installed
Verify Install-NerdFont functions correctly after the change
The
NerdFontsmodule depends on theAdminandFontsmodules. When either dependency is updated beyond the pinned version,Import-Module NerdFontsfails because the#Requiresdirectives useRequiredVersion, 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.
Originally reported by Michael Kriese (@viceice) in #53.
Request
What happens
When a user has a newer version of
Admin(e.g., 1.1.13) orFonts(e.g., 1.1.26) installed, importingNerdFontsfails: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
AdminandFontsshould satisfy the dependency constraint. The#Requiresdirectives should specify a minimum version, not an exact version, so that any version equal to or greater than the stated version is accepted.Environment
Regression
This was not previously noticeable because the dependency modules had not been updated beyond the pinned versions. It became a problem once
AdminandFontsreleased newer versions.Workaround
Manually install the exact pinned versions of
Admin(1.1.6) andFonts(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#Requiresdirectives useModuleVersion(minimum version) instead ofRequiredVersion(exact version)Related
Fontsmodule's dependency onAdmin(fix merged via PSModule/Fonts#59)FontsNerdFontsTechnical decisions
Directive syntax: Change from
RequiredVersiontoModuleVersionin the#Requires -Moduleshashtable.ModuleVersionspecifies the minimum acceptable version, allowing any newer version to satisfy the constraint.Minimum versions: Bump the floor to the latest published versions of each dependency at the time of the fix, rather than carrying forward stale pins:
Admin:1.1.13(aligned with PSModule/Fonts#59)Fonts:1.1.26(latest published version)Both modules follow SemVer, so any future minor/patch release remains compatible.
Note
Why
ModuleVersion(minimum) instead ofRequiredVersion(exact pin):Per the official PowerShell module manifest documentation, version constraints in both
RequiredModulesand#Requires -Modulessupport three strategies:RequiredVersionModuleVersionModuleVersion+MaximumVersionExact pinning (
RequiredVersion) should be avoided for published modules that follow SemVer. It is the root cause of this bug.Test file: The test file
tests/NerdFonts.Tests.ps1also usesRequiredVersionforPester(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.Future consideration: migrate from
#Requiresto manifestRequiredModulesThe
#Requires -Modulesdirective on individual function files is evaluated at script scope and does not causeInstall-Module/Install-PSResourceto auto-install dependencies. It only asserts presence at load time.The module manifest
RequiredModuleskey, by contrast:Install-Module NerdFontsModuleVersion/MaximumVersion/RequiredVersionsyntaxMoving the
AdminandFontsdependency declarations from per-file#Requiresdirectives toRequiredModulesin the module manifest would eliminate duplication and give users automatic dependency resolution. This is tracked as a follow-up, not part of this fix.Implementation plan
Core changes
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.26' }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.13' }Verification
Import-Module NerdFontssucceeds with newer versions ofAdminandFontsinstalledImport-Module NerdFontsstill succeeds with the exact minimum versions installedInstall-NerdFontfunctions correctly after the change