Skip to content

Commit 04cb61b

Browse files
authored
Better parsing of node version (emscripten-core#16500)
I was experimenting with the canary version of node which reports a version of `v18.0.0-v8-canary2022031068abd7e7cd`
1 parent 43ad4ce commit 04cb61b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/shared.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ def env_with_node_in_path():
305305
def check_node_version():
306306
try:
307307
actual = run_process(config.NODE_JS + ['--version'], stdout=PIPE).stdout.strip()
308-
version = actual.replace('v', '').replace('-pre', '').split('.')
308+
version = actual.replace('v', '')
309+
version = version.split('-')[0].split('.')
309310
version = tuple(int(v) for v in version)
310311
except Exception as e:
311312
diagnostics.warning('version-check', 'cannot check node version: %s', e)

0 commit comments

Comments
 (0)