diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 9e53472924..38a9599177 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -247,13 +247,13 @@ def output_system_info(): if system != "Windows": dependencies.extend( [ - f"[FNM {constants.Fnm.VERSION} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]", + f"[FNM {prerequisites.get_fnm_version()} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]", f"[Bun {prerequisites.get_bun_version()} (Expected: {constants.Bun.VERSION}) (PATH: {config.bun_path})]", ], ) else: dependencies.append( - f"[FNM {constants.Fnm.VERSION} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]", + f"[FNM {prerequisites.get_fnm_version()} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]", ) if system == "Linux": diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 6852850694..9b558390bc 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -60,6 +60,19 @@ def get_node_version() -> version.Version | None: return None +def get_fnm_version() -> version.Version | None: + """Get the version of fnm. + + Returns: + The version of FNM. + """ + try: + result = processes.new_process([constants.Fnm.EXE, "--version"], run=True) + return version.parse(result.stdout.split(" ")[1]) # type: ignore + except (FileNotFoundError, TypeError): + return None + + def get_bun_version() -> version.Version | None: """Get the version of bun.