From be2b958a91cef3d38a85856385d70f76761b6d6e Mon Sep 17 00:00:00 2001 From: Max Melamed Date: Tue, 11 Jan 2022 12:32:17 -0500 Subject: [PATCH] Patch node installation for M1 --- nodeenv.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nodeenv.py b/nodeenv.py index 2ca89ea..79475f6 100644 --- a/nodeenv.py +++ b/nodeenv.py @@ -756,7 +756,12 @@ def install_node_wrapped(env_dir, src_dir, args): # get src if not downloaded yet if not os.path.exists(node_src_dir): - download_node_src(node_url, src_dir, args) + try: + download_node_src(node_url, src_dir, args) + except urllib2.HTTPError: + if "arm64" in node_url: + # if arm64 not found, try x64 + download_node_src(node_url.replace('arm64', 'x64'), src_dir, args) logger.info('.', extra=dict(continued=True))