thecodejack thecodejack - 1 year ago 219
Javascript Question

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

I have my own private npm registry

. I installed yarn and trying to run following command.


But it is giving following error.

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. (Available in 0.16.0)

Looks like i have to set
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.


config: {
"strict-ssl": false


"strict-ssl": false

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

Answer Source

Realised that config needs to get into .yarnrc file. I have set following to get it worked.

cafile null
strict-ssl false

Also please note that yarn also takes config options from .npmrc file as well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download