问题描述
在npm install时出现以下问题:
npm ERR! Error while executing:
npm ERR! D:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git
npm ERR!
npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': OpenSSL SSL_read: Connection was reset, errno 10054
npm ERR!
解决方法
应该由于npm install的网络的问题造成,建议将npm的源设置为国内的镜像,这样就可以大幅提升依赖安装速度。但是我使用淘宝镜像为
npm config set registry https://registry.npm.taobao.org
时并没用,然后将阿里淘宝镜像换成
npm config set registry https://registry.npmmirror.com
即可成功运行了。
1、 临时使用
npm --registry https://registry.npmmirror.com install express
2、持久使用
npm config set registry https://registry.npmmirror.com