npm 安装失败 EPROTO 获取请求失败 [英] npm install failed EPROTO fetch request failed
问题描述
当我尝试从 npm 安装软件包时,我收到了 fetch failed 错误.我设置了 npm 的配置:- 将strict-ssl 设置为false- 使用 https://registry.npmjs.org/ 设置注册表- 设置代理和https-proxy
I get fetch failed error when I try to install a package from npm. I set the config of the npm: - set strict-ssl to false - set registry with https://registry.npmjs.org/ - set the proxy and https-proxy
当我搜索包时,注册表的 get 方法工作正常,但是当我尝试安装时,出现错误
When I search a package, the get method to the registry worked fine however when I try to install, I got an error
我使用最新版本的 Node 8.9.1 和 npm 5.5.1 升级我的节点后出现此错误.
I got this error after I upgrade my node with the last version of Node 8.9.1 with npm 5.5.1.
我尝试了很多方法来修复它:- 删除内容并使用代理,strict-ssl 重新配置我的 .npmrc 设置- 降级到我的最新版本,即 node 4 版本,但它不起作用......
I tried many things to fix it: - deleted the content and reconfigured my .npmrc settings with proxy, strict-ssl - downgrade to my latest version which was the node 4 version however it doesn't work ....
这是我得到的错误:
信息如果以 ok 结尾就有效
详细 cli ['C:\Applications\Nodejs\node.exe',
详细的cli
'C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
详细的 cli '安装',
详细的 cli 'create-react-class',
详细的 cli '--save',
详细的 cli '--verbose' ]
信息使用 npm@5.5.1
信息使用 node@v4.7.0
详细的 npm 会话 3edca0dd78623f79
傻安装 loadCurrentTree
傻安装 readLocalPackageData
对 https://registry.npmjs.org 的 create-react-class@latest 请求的愚蠢 fetchPackageMetaData 错误/create-react-class 失败,原因:写入 EPROTO 101057795:error:140770FC:SSLroutines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
详细类型系统
详细堆栈 FetchError:请求 https://registry.npmjs.org/create-react-class 失败,原因:写入 EPROTO 101057795:错误:140770FC:SSL 例程:SSL23_GET_SERVER_HELLO:未知协议:openssl\ssl\s23_clnt.c:794:
详细堆栈
ClientRequest 中的详细堆栈.(C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
emitOne 上的详细堆栈 (events.js:77:13)
ClientRequest.emit 上的详细堆栈 (events.js:169:7)
onerror 时的详细堆栈
(C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)
callbackError 处的详细堆栈 (C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.htmljs:126:5)
详细 cwd D:\Users\xxxxxxxxx\Documents\PycharmWorkspace\
详细 Windows_NT 6.1.7601
详细 argv "C:\Applications\Nodejs\node.exe" "C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "create-react-class""--save" "--详细"
详细节点 v4.7.0
详细的 npm v5.5.1
错误代码 EPROTO
错误 errno EPROTO
https://registry.npmjs.org/create-react-class 的错误请求失败,原因:写入 EPROTO 101057795:error:140770FC:SSL 例程:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
详细退出 [ 1, true ]
info it worked if it ends with ok
verbose cli [ 'C:\Applications\Nodejs\node.exe',
verbose cli
'C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
verbose cli 'install',
verbose cli 'create-react-class',
verbose cli '--save',
verbose cli '--verbose' ]
info using npm@5.5.1
info using node@v4.7.0
verbose npm-session 3edca0dd78623f79
silly install loadCurrentTree
silly install readLocalPackageData
silly fetchPackageMetaData error for create-react-class@latest request to https://registry.npmjs.org/create-react-class failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
verbose type system
verbose stack FetchError: request to https://registry.npmjs.org/create-react-class failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
verbose stack
verbose stack at ClientRequest. (C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
verbose stack at emitOne (events.js:77:13)
verbose stack at ClientRequest.emit (events.js:169:7)
verbose stack at onerror
(C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)
verbose stack at callbackError (C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:126:5)
verbose cwd D:\Users\xxxxxxxxx\Documents\PycharmWorkspace\
verbose Windows_NT 6.1.7601
verbose argv "C:\Applications\Nodejs\node.exe" "C:\Users\xxxxxxxxx\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "create-react-class" "--save" "--verbose"
verbose node v4.7.0
verbose npm v5.5.1
error code EPROTO
error errno EPROTO
error request to https://registry.npmjs.org/create-react-class failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
verbose exit [ 1, true ]
推荐答案
我按照这篇文章从我的计算机中完全删除 node.js 和 npm 来解决这个问题 如何从 Windows 中完全删除 node.js
I fix the problem by completely removing node.js and npm from my computer following this post How to completely remove node.js from Windows
这篇关于npm 安装失败 EPROTO 获取请求失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!