Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR:root:code for hash md5 was not found. Error in npm install

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
like image 904
Arun Ramachandran Avatar asked Feb 03 '20 12:02

Arun Ramachandran


2 Answers

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
like image 188
Raekh Void Avatar answered Oct 05 '22 11:10

Raekh Void


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

like image 27
Mouad EL Fakir Avatar answered Oct 05 '22 12:10

Mouad EL Fakir