【问题标题】:ERROR:root:code for hash md5 was not found. Error in npm install错误:root:未找到哈希 md5 的代码。 npm 安装出错
【发布时间】:2020-05-19 04:52:05
【问题描述】:

我在 StackOverflow 中发现了一些带有标题标签 - ERROR:root:code for hash md5 was not found 的类似问题,但我无法将其与我在安装 npm 时所面临的问题联系起来。

我使用的是 macOS High Sierra (10.13.6)

带有节点版本v8.0.0 & npm v5.0.0

我在尝试将 Webpack 安装到我的项目中时收到以下错误消息。

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.

我尝试将我的 node 和 npm 版本分别切换到 v12.0.0 和 v6.9.0,但它遵循相同的错误。

有人知道吗?如何解决这个问题?我觉得它应该更像是一个配置,而不是一个特定的包安装。

提前感谢您的帮助!

附加信息:

我正在运行python version: 2.7.16

更新:

我刚刚观察到在我的系统中安装所有 npm 都会出现同样的错误。

遵循此question 和随之提供的解决方法,会在堆栈中引入不同的错误:

> 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

【问题讨论】:

标签: javascript python node.js npm webpack


【解决方案1】:

如果您遵循此修复程序会发生什么? node-gyp issues

编辑:根据 Blackfurnace 的建议进行编辑。

如果您遇到的问题与 node-gyp 有关,以下命令应该可以解决它:

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools

【讨论】:

    【解决方案2】:

    运行后修复

    brew upgrade openssl
    

    在此处关注答案:"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands

    【讨论】:

      猜你喜欢
      • 2017-06-07
      • 2020-03-22
      • 2020-05-30
      • 1970-01-01
      • 2020-04-03
      • 1970-01-01
      • 2019-08-20
      相关资源
      最近更新 更多