Command failed unable to get local issuer certificate

Viewed 1871

When I create a brand new create-react-app and run the command yarn add electron --dev I get the following error.

RequestError: unable to get local issuer certificate
    at ClientRequest.<anonymous> (C:\my-stuff\create-react-test\node_modules\got\source\request-as-event-emitter.js:178:14)
    at Object.onceWrapper (events.js:520:26)
    at ClientRequest.emit (events.js:412:35)
    at ClientRequest.origin.emit (C:\my-stuff\create-react-test\node_modules\@szmarczak\http-timer\source\index.js:37:11)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)

The same thing happens with npm and chocolatey and only with electron. This doesn't happen on other computers. I've completely uninstalled node and reinstalled it.

This happens after it finished downloading the module. It is making a ClientRequest to a location on my computer. I don't understand why.

I've searched the internet for days for a solution. I've found the cnpm solution and it does work, but I want my project to be restorable from the git repository using npm install or yarn. Right now it is not. I'd have to remove electron from my package.json, restore, add it back and call the cnpm command.

npm config set strict-ssl false <- This command does not help.

I've tried separately installing got and @szmarczak\http-timer. This did not help.

0 Answers
Related