【问题标题】:How to fix a bug with a proxy?如何使用代理修复错误?
【发布时间】:2019-02-22 05:04:13
【问题描述】:

我想安装nodemon。但是当尝试安装时,得到这个错误:

sudo npm install -g nodemon

npm 错误!代码EPROTO

npm 错误! errno EPROTO

npm 错误!对registry.npmjs.org/nodemon的请求失败,原因:写EPROTO140097810798400:error:140770FC:SSLroutines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:

npm 错误!

npm 错误!可以在以下位置找到此运行的完整日志:

npm 错误! /root/.npm/_logs/2018-09-18T06_36_29_786Z-debug.log

以这种方式设置代理没有帮助

$ npm config set proxy http://...
$ npm config set https-proxy http://...

【问题讨论】:

标签: node.js npm


【解决方案1】:

我认为我们在这里遗漏了一些信息,但有些人报告了您遇到的相同问题,似乎答案是将 NPM 注册表 URL 设置为非 SSL 的。您可以使用此命令:

npm config set registry http://registry.npmjs.org/

参考:
https://github.com/npm/npm/issues/2050#issuecomment-3696752
https://github.com/npm/npm/issues/8976#issuecomment-123748215

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-29
    • 2016-07-19
    • 1970-01-01
    • 2012-11-15
    • 1970-01-01
    • 2021-12-06
    • 2015-06-01
    • 1970-01-01
    相关资源
    最近更新 更多