use larger or equal for node version check (#4189)

This commit is contained in:
Khaleel Al-Adhami 2024-10-16 15:20:51 -07:00 committed by GitHub
parent d8ea2fc795
commit 35810fe1bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,14 +146,9 @@ def check_node_version() -> bool:
Whether the version of Node.js is valid. Whether the version of Node.js is valid.
""" """
current_version = get_node_version() current_version = get_node_version()
if current_version: return current_version is not None and current_version >= version.parse(
# Compare the version numbers constants.Node.MIN_VERSION
return ( )
current_version >= version.parse(constants.Node.MIN_VERSION)
if constants.IS_WINDOWS or path_ops.use_system_node()
else current_version == version.parse(constants.Node.VERSION)
)
return False
def get_node_version() -> version.Version | None: def get_node_version() -> version.Version | None: