Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: unable to get local issuer certificate while running yarn command

I have my own private npm registry http://something. I installed yarn and trying to run following command.

yarn 

But it is giving following error.

Trace:    Error: unable to get local issuer certificate       at Error (native)       at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)       at emitNone (events.js:67:13)       at TLSSocket.emit (events.js:166:7)       at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)       at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38) 

I found couple of github issue and resolution as well.

https://github.com/yarnpkg/yarn/issues/841 https://github.com/yarnpkg/yarn/commit/b0611a6ee5220b0b1e955b271b6140640158f96c (Available in 0.16.0)

Looks like i have to set strict-ssl to false in yarn config. I am unable to find exactly how can I do that. I tried giving option in following ways in package.json but didn't work.

1)

{ config: { "strict-ssl": false } } 

2)

{ "strict-ssl": false } 

But still I am getting same error. Where am I doing wrong?

like image 456
thecodejack Avatar asked Oct 19 '16 06:10

thecodejack


People also ask

How do I fix unable to get local issuer certificate?

When ssl certificate problem unable to get local issuer certificate error is caused by a self-signed certificate, the fix is to add the certificate to the trusted certificate store. Open the file ca-bundle. crt located in the directory above, then copy and paste the Git SSL certificate to the end of the file.

How do I install yarn packages?

Step 1 — Installing Yarn Globally The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.


1 Answers

in Nodejs command prompt run the following command. then everything works. its bcos of running behind a proxy error

yarn config set "strict-ssl" false -g 
like image 101
Sundara Prabu Avatar answered Sep 21 '22 05:09

Sundara Prabu