Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

yarnpkg - Yarn: unable to verify the first certificate

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)

Same works fine with npm. Tried setting proxy, didn't help.Is there any configuration I need to change?

question from:https://stackoverflow.com/questions/40033794/yarn-unable-to-verify-the-first-certificate

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

But the command is currently not working, see issue 980.

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...