How to Install cypress in Windows & Mac using zip file, if NPM cypress fails?

Cypress is one of the modern JavaScript /TypeScript based Testing framework and is becoming more and more popular mainly due to:
1. Easy to use cypress commands which has ability to auto wait for elements.
2. Can be used for both UI and API testing.
3. Provides additional plugin to test the website Accessibility features.
4. Tool setup is very easy.
5. No additional web driver initialization/setup
6. Interactive dashboard feature which is built in which provides easy snapshot of each and every executed test steps.
Challenge:
One of the roadblock which you might have experienced while trying to install cypress in the Corporate work environment is that while running Cypress installation command, download may fail. This may occur even if no proxy settings exists for the organization, which can be used during the installation steps. Sample error provided below:

Solution -1:
One of alternate way to install as recommended in cypress website is to manually download the zip file from CDN and then try the installation steps.
Step 1: Download the zip file and save it your preferred desktop location. Do not unzip
https://download.cypress.io/desktopStep 2: In the Vscode Terminal run the following command:
setx CYPRESS_INSTALL_BINARY C:\\Users\\MyDocuments\\cypress.zipStep 3: Above command will take some time to extract the zip file. Restart the vscode.
Step 4: Now open a new Terminal and run the following command
npm i cypress --save-devThis will find the extracted cypress files which is now pointing to the global config path instead of trying to extract from the cypress library.
It may take around 10mins or less based on the Internet speed.
Step 5: Once cypress is installed, you may notice that “package.json” may show the cypress under dev dependencies. However you may notice that there is no folder called ‘Cypress’ yet in the project directory. So run this command:
npx cypress open
This will open the dashboard service in a new window. At this time you will see that cypress folder is now visible under project directory.

Solution -2:
In case of “Error: self signed certificate in certificate chain”, follow the steps as below:
- Disconnect from the company VPN.
- Run the cypress install command again with ssl as false
npm i cypress --save-dev --strict-ssl=falseThis will bypass the ssl certificate error and install the cypress.
References:
https://docs.cypress.io/guides/references/advanced-installation
Happy Reading!!!
Please like and comment for any other issues which you might have encountered.
