Skip to content

Commit

Permalink
refactor: remove node version check (#4019)
Browse files Browse the repository at this point in the history
This PR removes the check for **npm** command version.  v6 is implicitly required by the `npm ci` command.
  • Loading branch information
dulmandakh authored and joeyparrish committed Mar 22, 2022
1 parent 15fad6e commit 26864ba
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions build/shakaBuildHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,6 @@ def _modules_need_update():

return False


def _parse_version(version):
"""Converts the given string version to a tuple of numbers."""
# Handle any prerelease or build metadata, such as -beta or -g1234
if '-' in version:
version, trailer = version.split('-')
else:
# Versions without a trailer should sort later than those with a trailer.
# For example, 2.5.0-beta comes before 2.5.0.
# To accomplish this, we synthesize a trailer which sorts later than any
# _reasonable_ alphanumeric version trailer would. These characters have a
# high value in ASCII.
trailer = '}}}'
numeric_parts = [int(i) for i in version.split('.')]
return tuple(numeric_parts + [trailer])


def get_source_base():
"""Returns the absolute path to the source code base."""
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
Expand Down Expand Up @@ -338,14 +321,6 @@ def update_node_modules():

base = cygwin_safe_path(get_source_base())

# Check the version of npm.
version = execute_get_output(['npm', '-v']).decode('utf8')

if _parse_version(version) < _parse_version('5.0.0'):
logging.error('npm version is too old, please upgrade. e.g.:')
logging.error(' npm install -g npm')
return False

# Update the modules.
# Actually change directories instead of using npm --prefix.
# See npm/npm#17027 and shaka-project/shaka-player#776 for more details.
Expand Down

0 comments on commit 26864ba

Please sign in to comment.