【问题标题】:Getting UNABLE_TO_VERIFY_LEAF_SIGNATURE from NPM when installing hexo-cli安装 hexo-cli 时从 NPM 获取 UNABLE_TO_VERIFY_LEAF_SIGNATURE
【发布时间】:2021-04-02 00:35:21
【问题描述】:

当我尝试在 Windows 上安装 hexo-cli 时收到 UNABLE_TO_VERIFY_LEAF_SIGNATURE 错误。我已经尝试切换到另一个镜像,但这并没有解决问题。

【问题讨论】:

  • 将截图直接嵌入到帖子中可以更清楚地了解它的内容。

标签: node.js windows npm


【解决方案1】:

您是否支持公司代理?他们很可能使用自签名 SSL 证书拦截和 MiTM 流量。

一个 hacky 解决方案就是关闭 NPM 的 SSL

npm set strict-ssl false

更详细的说明可以在这里找到:How to fix SSL certificate error when running Npm on Windows?

参考文献:

https://github.com/Medium/phantomjs#i-am-behind-a-corporate-proxy-that-uses-self-signed-ssl-certificates-to-intercept-encrypted-traffic

https://security.stackexchange.com/questions/101721/is-it-possible-for-corporation-to-intercept-and-decrypt-ssl-tls-traffic

【讨论】:

  • Err Windows_NT 6.1.7601怎么解释?是不是说我的windows版本不兼容npm?
  • 我尝试“npm set strict-ssl false”,还是不行
【解决方案2】:

请按照此处所述的说明进行操作:

How to fix SSL certificate error when running Npm on Windows?

正如作者所说,这里点使用NODE_EXTRA_CA_CERTS环境变量。请记住,设置 npm config set cafile <path> 会导致 npm 仅使用该文件中提供的证书,而不是使用它扩展现有证书。

【讨论】:

    猜你喜欢
    • 2016-06-12
    • 2013-08-12
    • 1970-01-01
    • 2014-12-03
    • 2021-02-13
    • 2017-12-21
    • 1970-01-01
    • 2014-01-11
    • 2020-12-19
    相关资源
    最近更新 更多