npm install failed EPROTO fetch request failed

只谈情不闲聊 提交于 2020-01-03 19:03:11

问题


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

When I search a package, the get method to the registry worked fine however when I try to install, I got an error

I got this error after I upgrade my node with the last version of Node 8.9.1 with npm 5.5.1.

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 ....

This is the error that I got:

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 ]


回答1:


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



来源:https://stackoverflow.com/questions/47206374/npm-install-failed-eproto-fetch-request-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!