Skip to content

Issue with os.uname() machine identifier text case #369

Open
@ChrisHughesLogi

Description

@ChrisHughesLogi

Trying to install nodeenv==1.9.1 and running into the following issue on an aarch64 Surface CoPilot PC:

    * Install prebuilt node (22.9.0)
    Traceback (most recent call last):
      File "<frozen runpy>", line 198, in _run_module_as_main
      File "<frozen runpy>", line 88, in _run_code
      File ".venv\Lib\site-packages\nodeenv.py", line 1548, in <module>
        main()
      File ".venv\Lib\site-packages\nodeenv.py", line 1130, in main
        create_environment(env_dir, args)
      File ".venv\Lib\site-packages\nodeenv.py", line 1006, in create_environment
        install_node(env_dir, src_dir, args)
      File ".venv\Lib\site-packages\nodeenv.py", line 763, in install_node
        install_node_wrapped(env_dir, src_dir, args)
      File ".venv\Lib\site-packages\nodeenv.py", line 779, in install_node_wrapped
        node_url = get_node_bin_url(args.node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File ".venv\Lib\site-packages\nodeenv.py", line 570, in get_node_bin_url
        'arch': archmap[platform.machine()],
                ~~~~~~~^^^^^^^^^^^^^^^^^^^^
    KeyError: 'ARM64'

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 of platform.machine() to lowercase before looking up in archmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions