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?
yarnrc files allow you to configure additional Yarn features. The config command may also be used to set these options. Yarn will merge . yarnrc files up the file tree.
In terms of speed and performance Yarn is better than NPM because it performs parallel installation. Yarn is still more secure than NPM. However, Yarn uses more disk space than NPM.
To solve this, you'll need to install it as a trusted server. If it's signed by a non-trusted CA, you'll have to install that CA's certificate as well.
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
This means that more than likely you're behind a corporate proxy that uses a self signed certificate. I'm using version v0.16.1
, and you can fix this by providing the public certificate to the yarn configuration like so:
yarn config set cafile <path-to-certificate.pem>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With