Steps to reproduce:
git clone https://github.com/nodejs/nodecd node./configureThe result:
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
WARNING: C++ compiler (CXX=c++, 7.0.2) too old, need g++ 6.3.0 or clang++ 8.0.0
WARNING: warnings were emitted in the configure phase
Traceback (most recent call last):
File "./configure", line 27, in <module>
import configure
File "/Users/administrator/gabrielschulhof/node/configure.py", line 1811, in <module>
run_gyp(gyp_args)
File "tools/gyp_node.py", line 54, in run_gyp
rc = gyp.main(args)
File "tools/gyp/pylib/gyp/__init__.py", line 547, in main
return gyp_main(args)
File "tools/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "tools/gyp/pylib/gyp/generator/make.py", line 2213, in GenerateOutput
part_of_all=qualified_target in needed_targets)
File "tools/gyp/pylib/gyp/generator/make.py", line 794, in Write
extra_mac_bundle_resources, part_of_all)
File "tools/gyp/pylib/gyp/generator/make.py", line 978, in WriteActions
part_of_all=part_of_all, command=name)
File "tools/gyp/pylib/gyp/generator/make.py", line 1724, in WriteDoCmd
force = True)
File "tools/gyp/pylib/gyp/generator/make.py", line 1779, in WriteMakeRule
cmddigest = hashlib.sha1((command or self.target).encode('utf-8')).hexdigest()
AttributeError: 'module' object has no attribute 'sha1'
master is at 96f06e6482b36e90687c9f767356020279f1bd9e.
From stackoverflow it looks like python may be messed up. I tried to brew reinstall python and brew reinstall python@2 but the former had some kind of link failure and the latter failed entirely.
test-macstadium-macos10:node administrator$ brew reinstall python@2
Warning: You are using macOS 10.10.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
==> Reinstalling python@2
Error: An exception occurred within a child process:
FormulaUnavailableError: No available formula with the name "/usr/local/opt/python@2/.brew/[email protected]"
Looking at the python code it may also be the case that it is not finding the openssl implementation.
test-macstadium-macos10:node administrator$ brew reinstall python
Warning: You are using macOS 10.10.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.
==> Reinstalling python
==> Downloading https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tar.xz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/44c7cdeb71f219f19f54e427000915c3e979312d73f8aabc41093d53a991c801--Python-3.7.7.tar.xz
==> ./configure --prefix=/usr/local/Cellar/python/3.7.7 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/3.7.7/share --datadir=/usr/local/Cellar/python/3.7.7/share --enable-framework=/us
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/3.7.7
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/3.7.7/share/python
==> Downloading https://files.pythonhosted.org/packages/df/ed/bea598a87a8f7e21ac5bbf464102077c7102557c07db9ff4e207bd9f7806/setuptools-46.0.0.zip
Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/e5199bbf2a8e2450a866445f256b9ca0f890309f843300835d2c4d3ebf9769d3--setuptools-46.0.0.zip
==> Downloading https://files.pythonhosted.org/packages/8e/76/66066b7bc71817238924c7e4b448abdb17eb0c92d645769c223f9ace478f/pip-20.0.2.tar.gz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/81c6f6c92bea8093b41c52486c1d47040fdaa166eba7820a14b14fc6fe4e1fd8--pip-20.0.2.tar.gz
==> Downloading https://files.pythonhosted.org/packages/75/28/521c6dc7fef23a68368efefdcd682f5b3d1d58c2b90b06dc1d0b805b51ae/wheel-0.34.2.tar.gz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/553d732b4cf117039b60aab1f75ac3e6f6869a9fa3127b4107984fa5b084a00b--wheel-0.34.2.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink Frameworks/Python.framework/Headers
Target /usr/local/Frameworks/Python.framework/Headers
is a symlink belonging to python@2. You can unlink it:
brew unlink python@2
To force the link and overwrite all conflicting files:
brew link --overwrite python
To list all files that would be deleted:
brew link --overwrite --dry-run python
Possible conflicting files are:
/usr/local/Frameworks/Python.framework/Headers -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Headers
/usr/local/Frameworks/Python.framework/Python -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Python
/usr/local/Frameworks/Python.framework/Resources -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Resources
/usr/local/Frameworks/Python.framework/Versions/Current -> /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/Current
==> /usr/local/Cellar/python/3.7.7/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python/3.7.7/bin --install-lib=/usr/local/lib/python3.7
==> /usr/local/Cellar/python/3.7.7/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python/3.7.7/bin --install-lib=/usr/local/lib/python3.7
==> /usr/local/Cellar/python/3.7.7/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python/3.7.7/bin --install-lib=/usr/local/lib/python3.7
==> Caveats
Python has been installed as
/usr/local/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
馃嵑 /usr/local/Cellar/python/3.7.7: 8,615 files, 120.8MB, built in 3 minutes 11 seconds
brew link --overwrite python worked as suggested by the error message.
This is most likely the same as https://github.com/nodejs/build/issues/2238 (which I think only fixed the 10.11 macs).
fyi @AshCripps
seeing the same on 12.x on 10.15.4. Trying an xcode upgrade (11.4 to 11.4.1)
update brew uninstall of all pythons python@2 and [email protected] etc (yes, breaking all the things) and going back to /usr/bin/python worked.
another update
On a lark, I read the manual 馃ぃ https://docs.brew.sh/Homebrew-and-Python
Homebrew provides formulae to brew Python 3.x.
Homebrew provided a python@2 formula until the end of 2019, at which point it was removed due to the Python 2 deprecation.
So, I did still have python@2. I'm wondering if an 'orphaned' python@2 may be the culprit here as @gabrielschulhof hit. If the formula is gone, then python@2 won't have its deps updated anymore
FormulaUnavailableError: No available formula with the name "/usr/local/opt/python@2/.brew/[email protected]"
see discussions in https://github.com/nodejs/node-gyp/issues/1337#issuecomment-486087002
Is there a way Node could detect this situation and suggest something? I'm not sure what the right fix is exactly. Perhaps brew uninstall python@2 --ignore-dependencies and just be aware that any remaining dependencies are probably already broken?
Update I forgot that I was on a 12.x branch, should mention that!
Is this issue still open?
Python 2 died on 1/1/2020 so brew uninstall python@2 is recommended.
If you have done brew install python and/or brew install [email protected] then a current version of node-gyp should be working properly. If it is not, then please provide the command that was typed and the complete error log.
I've been starting several Node.js 10 builds today (I believe we only build Node.js 10 on macOS 10.10 now) and haven't seen the issue reported here.
Most helpful comment
Is this issue still open?
Python 2 died on 1/1/2020 so
brew uninstall python@2is recommended.If you have done
brew install pythonand/orbrew install [email protected]then a current version of node-gyp should be working properly. If it is not, then please provide the command that was typed and the complete error log.