npm postinstall fails behind an HTTPS proxy
See original GitHub issueCurrent behavior:
I’m running behind an HTTPS corporate proxy configured with a self-signed certificate. This requires to setup the self-signed certificate with NODE_EXTRA_CA_CERTS
environment variable.
yarn install cypress
gives the following error (same with npm)
> cypress@2.1.0 postinstall /app/oison-frontend/node_modules/cypress
> node index.js --exec install
Installing Cypress (version: 2.1.0)
✖ Downloading Cypress
→ Cypress Version: 2.1.0
Unzipping Cypress
Finishing Installation
The Cypress App could not be downloaded.
Please check network connectivity and try again:
----------
URL: https://download.cypress.io/desktop/2.1.0?platform=linux&arch=x64
Error: self signed certificate in certificate chain
----------
Platform: linux (Debian - 8.10)
Cypress Version: 2.1.0
It seems NODE_EXTRA_CA_CERTS
is not honored by the post installation script downloading cypress binary.
Desired behavior:
It should work
How to reproduce:
Come to my company and have fun configuring this proxy sh*t.
Additional Info (images, stack traces, etc)
It was working yesterday, so I think something has changed in the package of 2.1.0
release.
- Operating System: Ubuntu
- Cypress Version: >=2.1
- Browser Version:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:31 (8 by maintainers)
Top Results From Across the Web
How can I solve the connection problem during npm install ...
Try this solution for installing electron node module from behind proxy. npx cross-env ELECTRON_GET_USE_PROXY=true ...
Read more >ngrok - npm
If you are behind a corporate proxy and have issues installing ngrok, you can set HTTPS_PROXY env var to fix it. ngrok's postinstall...
Read more >Working with NPM behind Network Proxy - Medium
NPM widely used to manage packages on Javascript project. This article demonstrates how to configure / set proxy for NPM to make it...
Read more >Advanced Installation Instructions | Electron
To install prebuilt Electron binaries, use npm. ... If you need to use an HTTP proxy, you need to set the ELECTRON_GET_USE_PROXY variable...
Read more >Configure your applications - develop-behind-proxy
If the environment variables are set, all post-install hooks should work properly. Certificate errors can be avoided by running npm config set strict-ssl...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this problem a few days ago and found that the best workaround was to download the zip file directly from the site then type the following command before attempting npm install. This should then install the file from your zip file. Hope that helps.
CYPRESS_BINARY_VERSION=/local/path/to/cypress.zip
Cypress should (at least) honor the following env vars, which is the de facto way of configuring proxy:
HTTP_PROXY
/http_proxy
HTTPS_PROXY
/https_proxy
Also, because it’s node:
NODE_EXTRA_CA_CERTS
And perhaps also the following npm configs:
cafile
https-proxy
proxy
Stuff like setting
NODE_TLS_REJECT_UNAUTHORIZED=0
or similar is out of the question, and defeats the whole purpose of secure connections.