server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

本文详细介绍了在Ubuntu系统中使用npm install时遇到的错误,即由于私用证书导致的HTTPS验证失败问题。提供了两种解决方法:一是通过git config命令全局关闭HTTP SSL验证;二是设置环境变量GIT_SSL_NO_VERIFY为1。这将帮助遇到类似问题的开发者快速定位并解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu系统

npm install 时报错如下:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://test.com/scm/saf/test.git
npm ERR! 
npm ERR! fatal: unable to access 'https://test.com/scm/saf/test.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
npm ERR! 
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/test/.npm/_logs/2020-05-08T03_03_55_220Z-debug.log


原因是使用了私用证书,查资料后,关闭系统的安全认证解决:

git config --global http.sslverify "false"

export GIT_SSL_NO_VERIFY=1

参考:https://blog.youkuaiyun.com/xunan003/article/details/82190419

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值