Windows:NPM:自签名证书

问题描述

我试图在安装 NPM 包时解决 self-signed certificate错误。我支持公司代理。特别是 zscaler

我正在按照说明 herethere

所以...我通过点击互联网页面上的锁下载了我的公司证书(.cer 文件)(我选择了 this 一个,因为如果我使用谷歌,我会获得谷歌签名的证书,而不是 zscaler一)我可以看到以下信息:

enter image description here

我使用 .cer 按钮将此信息导出为 copy to file 文件

然后我使用 cURL 从 this 网站下载了一个 .pem 文件

curl https://mkcert.org/generate/ > certs.pem

我最后添加了来自 zscaler 证书的信息。但是当我这样做时:

npm config set cafile "path/to/certs.pem"
npm install -g aws-cdk

我仍然有同样的问题:

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/aws-cdk Failed,reason: self signed certificate in certificate chain

感谢任何帮助!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)