15

I have found a few similar questions with title tag - ERROR:root:code for hash md5 was not found - in StackOverflow, but I couldn't relate it with the issue which I am facing at this moment during npm installation.

I'm on macOS High Sierra (10.13.6)

with node version v8.0.0 & npm v5.0.0

I am getting the following error message while trying to install Webpack into my project.

npm install --save-dev webpack webpack-dev-server webpack-cli

> node-gyp rebuild

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):

ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.

I have tried to switch my node & npm versions into v12.0.0 and v6.9.0 respectively, but it follows the same error.

Does anyone have any idea about it? How to resolve this issue? I feel it should be more of a config, rather than a specific package installation.

Thanks in advance for your help!

Additional info:

I am running on python version: 2.7.16

Update:

I have just observed that the same error follows with all npm installation in my system.

Following this question & workaround given along with it introduced a different error into the stack :

> node-gyp rebuild

  xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  xcode_version, _ = XcodeVersion()
  File"/Users/arunkramachandran/.nvm/versions/node/v8.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
Arun Ramachandran
  • 1,270
  • 5
  • 23
  • 36
  • Does this answer your question? [ERROR:root:code for hash md5 was not found - not able to use any hg mercurial commands](https://stackoverflow.com/questions/59269208/errorrootcode-for-hash-md5-was-not-found-not-able-to-use-any-hg-mercurial-co) – Raekh Void Feb 03 '20 at 12:25
  • @RaekhVoid Nope. In fact, that introduced an additional error to my installation stack now. I have updated the question with the new error message. Could you please have a look at it? – Arun Ramachandran Feb 03 '20 at 12:32
  • I had similar issue, below link solved it. https://stackoverflow.com/questions/59269208/errorrootcode-for-hash-md5-was-not-found-when-using-any-hg-mercurial-command – Bharat Sharma Oct 12 '20 at 06:56

2 Answers2

14

What happens then if you follow this fix? node-gyp issues

Edit: Editing this according to Blackfurnace's advice.

If the problem you're having is related to node-gyp, the following commands should fix it :

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
RobC
  • 22,977
  • 20
  • 73
  • 80
Raekh Void
  • 441
  • 3
  • 11
1

Fixed after running

brew upgrade openssl

Follow the answer here : "ERROR:root:code for hash md5 was not found" when using any hg mercurial commands

Mouad EL Fakir
  • 3,609
  • 2
  • 23
  • 37