electron: Electron fails to install on Windows 10 because of "self signed certificate in certificate chain"

npm install -D electron@2.0.0

electron@2.0.0 postinstall C:\Git\System_Console\Sources\Apps\mp4player\node_modules\electron node install.js

Downloading electron-v2.0.0-win32-x64.zip Error: self signed certificate in certificate chain C:\Git\System_Console\Sources\Apps\mp4player\node_modules\electron\install.js:47 throw err ^

Error: self signed certificate in certificate chain at TLSSocket.<anonymous> (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! electron@2.0.0 postinstall: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the electron@2.0.0 postinstall script. Also happening with “npm install electron@latest”

Expected Behavior Electron to install via npm

Actual behavior It fails to install as per noted above.

To Reproduce Steps provided above.

I’ve always worked on Ubuntu. Need to compile a windows version of the Electron app. This is Windows 10 clean machine. Installed Node (v8.12.0), NPM (6.4.1) and Git (for Windows). Checked out my source. Went to project folder and npm install and then gets error when installing electron.

Tried to re-install electron (as noted above) and same issue.

From package.json: “dependencies”: { “axios”: “^0.18.0”, “chokidar”: “^2.0.4”, “imports-loader”: “^0.8.0”, “lodash”: “^4.17.11”, “mime-types”: “^2.1.21”, “moment”: “^2.22.2”, “plyr”: “^3.4.5”, “pretty-bytes”: “^5.1.0”, “snapsvg”: “^0.5.1”, “vue-i18n”: “^7.3.3”, “vue-plyr”: “^4.0.0” }, “devDependencies”: { “babel-eslint”: “^8.2.1”, “devtron”: “^1.4.0”, “electron”: “^2.0.0”, “electron-builder”: “^20.29.0”, “electron-debug”: “^1.5.0”, “electron-devtools-installer”: “^2.2.4”, “electron-packager”: “^12.2.0”, “electron-toolkit”: “^1.0.24”, “eslint”: “^4.18.2”, “eslint-config-standard”: “^11.0.0”, “eslint-friendly-formatter”: “^4.0.1”, “eslint-loader”: “^2.0.0”, “eslint-plugin-import”: “^2.9.0”, “eslint-plugin-node”: “^6.0.1”, “eslint-plugin-promise”: “^3.7.0”, “eslint-plugin-standard”: “^3.0.1”, “eslint-plugin-vue”: “^4.3.0”, “quasar-cli”: “^0.17.20”, “strip-ansi”: “=3.0.1” },

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (2 by maintainers)

Most upvoted comments

Why is this closed. Still a problem 😦

I have the same problem. Corporate FW has MITM with self-signed cert. I added FWs self-signed cert to Trusted CA (Windows) and applied: npm config set strict-ssl false All packages installs fine, only electron has “RequestError: self signed certificate in certificate chain

Any solution?

I got the same problem here. the error occurs only in electron project

I am also facing the same issue

Same problem here, any news to this? Thx in advance

NODE_TLS_REJECT_UNAUTHORIZED=0 yarn global add electron worked for me

Could you possibly explain to me why this is only happening with Electron and not other NPM packages so I can give our sysadmin so relevant information?

any workaround for this?

same issue, same situation.

From VSCode terminal:

Windows PowerShell Copyright © Microsoft Corporation. All rights reserved.

PS C:\Git\System_Console\Sources\Apps\mp4player> npm install

electron@2.0.12 postinstall C:\Git\System_Console\Sources\Apps\mp4player\node_modules\electron node install.js

Downloading electron-v2.0.12-win32-x64.zip Error: self signed certificate in certificate chain C:\Git\System_Console\Sources\Apps\mp4player\node_modules\electron\install.js:54 throw err ^

Error: self signed certificate in certificate chain at TLSSocket.<anonymous> (_tls_wrap.js:1116:38) at emitNone (events.js:106:13) at TLSSocket.emit (events.js:208:7) at TLSSocket._finishInit (_tls_wrap.js:643:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38) npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! electron@2.0.12 postinstall: node install.js npm ERR! Exit status 1