When I run npm install
I get following error. It seems it can't download any package. I use node 8.2.1 and npm 5.3.0
Do you have any idea what is wrong?
npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz failed,
reason: write EPROTO 140640770651968:error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
npm logs:
0215 verbose type system
20216 verbose stack FetchError: request to https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz failed, reason: write EPROTO 140640770651968:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
20216 verbose stack
20216 verbose stack at ClientRequest.req.on.err (/home/pawel/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:68:14)
20216 verbose stack at emitOne (events.js:115:13)
20216 verbose stack at ClientRequest.emit (events.js:210:7)
20216 verbose stack at onerror (/home/pawel/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:106:9)
20216 verbose stack at callbackError (/home/pawel/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/index.js:126:5)
20216 verbose stack at <anonymous>
20217 verbose cwd /home/pawel/work/react-components
20218 verbose Linux 4.4.0-83-generic
20219 verbose argv "/home/pawel/.nvm/versions/node/v8.2.1/bin/node" "/home/pawel/.nvm/versions/node/v8.2.1/bin/npm" "install"
20220 verbose node v8.2.1
20221 verbose npm v5.3.0
20222 error code EPROTO
20223 error errno EPROTO
20224 error request to https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz failed, reason: write EPROTO 140640770651968:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
20225 verbose exit [ 1, true ]
I also had this problem. The following trick has worked for me.
It would be better if you upgrade your
node
andnpm
versions to latest. After that please follow the below steps.Try running
curl https://registry.npmjs.org/package-name
from your terminal to make sure that network call is not blocking the package requests tonpm
registry.If you are running behind a
proxy
, then you also have to configurenpm
to use it, and you can set it using:npm config set proxy http://proxyhost:proxyport
npm config set http-proxy http://proxyhost:proxyport
npm config set https-proxy http://proxyhost:proxyport
npm config set registry http://registry.npmjs.org/
Hope the above trick resolve your issue.