Open ChrisHughesLogi opened 2 weeks ago
I am getting a similar error on Ubuntu 24.04 while running pre-commit but with a different key aarch64
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/python3', '-mnodeenv', '--prebuilt', '--clean-src', '/home/abanand/.cache/pre-commit/repo4cqrh9kz/node_env-default')
return code: 1
stdout: (none)
stderr:
/usr/lib/python3/dist-packages/nodeenv.py:24: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
import pipes
/usr/lib/python3/dist-packages/nodeenv.py:37: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
* Install node (23.0.0Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/lib/python3/dist-packages/nodeenv.py", line 1042, in <module>
main()
File "/usr/lib/python3/dist-packages/nodeenv.py", line 890, in main
create_environment(env_dir, opt)
File "/usr/lib/python3/dist-packages/nodeenv.py", line 731, in create_environment
install_node(env_dir, src_dir, opt)
File "/usr/lib/python3/dist-packages/nodeenv.py", line 594, in install_node
node_url = get_node_src_url(opt.node, get_node_src_url_postfix(opt))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/nodeenv.py", line 503, in get_node_src_url_postfix
postfix_arch = arches[platform.machine()]
~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'aarch64'
Check the log at /home/abanand/.cache/pre-commit/pre-commit.log```
A hint here for pre-commit users, install pre-commit>=4.0.0
to avoid this error as it requires newer nodeenv. Still the bugfix proposed is still needed for a full fix of this problem on all platforms.
Trying to install nodeenv==1.9.1 and running into the following issue on an aarch64 Surface CoPilot PC:
It appears as if
archmap[platform.machine()]
is the culprit here, as the list of architectures defined here assumes all lower-case. I would suggest converting the value ofplatform.machine()
to lowercase before looking up inarchmap
.