I also had this problem. The following trick has worked for me.
It would be better if you upgrade your node
and npm
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 to npm
registry.
If you are running behind a proxy
, then you also have to configure npm
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…