Error: Cannot get local issuer certificate while yarn command is running

I have my own private npm registry http://something. I set the yarn and tried to execute the following command.

yarn

But this leads to the 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 a couple of github questions and solutions.

https://github.com/yarnpkg/yarn/issues/841 https://github.com/yarnpkg/yarn/commit/b0611a6ee5220b0b1e955b271b6140640158f96c (available at 0.16.0)

It looks like I need to set strict-sslto false in the yarn configuration. I can’t determine exactly how to do this. I tried to provide the option in the following ways in package.json, but did not work.

1)

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

2)

{
"strict-ssl": false
}

But still I get the same error. Where am I doing wrong?

+4
2

, config .yarnrc. , .

cafile null
strict-ssl false

, .npmrc.

+5

Nodejs . . bcos -

yarn config set "strict-ssl" false -g
+3

Source: https://habr.com/ru/post/1658167/


All Articles