记录:unable to verify the first certificate 错误解决方案
在下载esno时出现错误提示,对解决方案进行记录
unable to verify the first certificate
问题原因:2014年2月27日,npm不再支持自签名证书。因为npm install走的是https协议,需要通过数字证书来保证的。
对应解决方案
- 暂时取消ssl验证
npm config set strict-ssl false
- 下载后再进行开启
npm config set strict-ssl true
在使用googleapis连接google文档报错,也同样是由于ssl数字证书导致的
failed, reason: unable to get local issuer certificate
可通过在node.js调用请求前里设置环境变量解决
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"