From 101fb1b5405e2aa20e91efa21ecb77068e7e3fd4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 15:21:47 -0700 Subject: [PATCH] check for none before returning which (#4187) --- reflex/utils/path_ops.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index f597e0075..f795e1aa4 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -185,7 +185,8 @@ def get_node_path() -> str | None: """ node_path = Path(constants.Node.PATH) if use_system_node() or not node_path.exists(): - return str(which("node")) + system_node_path = which("node") + return str(system_node_path) if system_node_path else None return str(node_path) @@ -197,7 +198,8 @@ def get_npm_path() -> str | None: """ npm_path = Path(constants.Node.NPM_PATH) if use_system_node() or not npm_path.exists(): - return str(which("npm")) + system_npm_path = which("npm") + return str(system_npm_path) if system_npm_path else None return str(npm_path)