纱线:无法验证第一个证书 [英] Yarn: unable to verify the first certificate
问题描述
我正在尝试从 npm 迁移到 Yarn.当我尝试通过纱线安装依赖项时,出现此错误.
I'm trying to migrate from npm to Yarn. When I tried to install dependencies through yarn, I'm getting this error.
unable to verify the first certificate
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1055:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:580:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:412:38)
同样适用于 npm.尝试设置代理,没有帮助.是否需要更改任何配置?
Same works fine with npm. Tried setting proxy, didn't help.Is there any configuration I need to change?
推荐答案
如果无法验证证书,可以打开 set strict-ssl 为 false.您应该能够通过运行来配置它
If the certificate is unable to be verfied, you can open set strict-ssl to false. You should be able to configure this by runnning
yarn config set "strict-ssl" false -g
但该命令目前不起作用,请参阅issue 980.
But the command is currently not working, see issue 980.
作为替代,您可以导航到 C:\Users\\ 并打开 .yarnrc
并手动更新它,如下所示:
As an alternative you can navigate to C:\Users\\ and open .yarnrc
and manually update it as follows:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
strict-ssl false
这篇关于纱线:无法验证第一个证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!