Skip to content

Nodeenv fails under M1 Mac with nodeenv V1.6.0 #283

Closed

Description

@DudeNr33

Apparently the fix for #280 alone is not enough to get this to work on M1 macs.
While the script no longer complains about the unknown architecture, it now runs into a HTTP 404 error:

An unexpected error has occurred: CalledProcessError: command: ('/Users/andreas/programming/forks/pylint/venv38/bin/python3', '-mnodeenv', '--prebuilt', '--clean-src', '/Users/andreas/.cache/pre-commit/repoygl38thg/node_env-default')
return code: 1
expected return code: 0
stdout: (none)
stderr:
     * Install prebuilt node (15.14.0) .
    Traceback (most recent call last):
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 1494, in <module>
        main()
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 1079, in main
        create_environment(env_dir, opt)
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 956, in create_environment
        install_node(env_dir, src_dir, opt)
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 721, in install_node
        install_node_wrapped(env_dir, src_dir, opt)
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 743, in install_node_wrapped
        download_node_src(node_url, src_dir, opt)
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 570, in download_node_src
        dl_contents = io.BytesIO(urlopen(node_url).read())
      File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/nodeenv.py", line 606, in urlopen
        return urllib2.urlopen(req)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
        return opener.open(url, data, timeout)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 531, in open
        response = meth(req, response)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 640, in http_response
        response = self.parent.error(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 569, in error
        return self._call_chain(*args)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
        result = func(*args)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 649, in http_error_default
        raise HTTPError(req.full_url, code, msg, hdrs, fp)
    urllib.error.HTTPError: HTTP Error 404: Not Found

It seems like there are no ARM64 builds for darwin available yet:
https://nodejs.org/dist/v15.14.0/

Since the availability of a darwin-arm64 build can't be fixed from nodeenvside, I suggest at least to output a proper error message, such as:

Unable to find a suitable build for node Vx.y.z and architecture darwin-arm64

Activity

  1. ekalinin commented on May 9, 2021

    @ekalinin
    Owner

    Yep, binaries are available for >= 16 only:

    So, solution is just to try again (with version 16.1.0, for example):

    ➜ curl -s https://nodejs.org/dist/v16.1.0/ | grep -o node-v16.1.0-darwin-arm64.tar.gz | uniq
    node-v16.1.0-darwin-arm64.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions