Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DudeNr33 opened this issue Apr 9, 2021 · 1 comment
Closed

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

DudeNr33 opened this issue Apr 9, 2021 · 1 comment

Comments

@DudeNr33
Copy link

DudeNr33 commented Apr 9, 2021

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
@ekalinin
Copy link
Owner

ekalinin commented May 9, 2021

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants