Steps for Cypress Installation
How to install Cypress?
There are two ways to get started with Cypress installation.
1. Using NPM
To install Cypress using the npm (Node package manager) navigate to the project directory and execute the following command:
npm init
The command above creates the package.json file. Just provide fundamental details like — package name, description, keywords, and author name.
The image below represents the final package.json file once the user fills up the details.
Once done, run the command below to install Cypress.
npm install cypress --save-dev
The command above installs Cypress locally as a dev dependency for the particular project.
Note: Users need to ensure that they have already executed the npm init command. One must also verify the existence of the node_modules folder or package.json file in the root of the project to ensure Cypress is installed in the target directory.
For users willing to install Cypress using the Yarn package manager, navigate to the project directory, and execute the following command:
yarn add cypress --dev
2. Downloading Cypress Directly
For users who are not acquainted with npm, yet want to instantly try Cypress, it is possible to directly download the zip file of Cypress from the CDN.
The direct download link automatically detects the user’s platform and fetches the zip file with the latest version of Cypress. Bear in mind that users that have downloaded Cypress directly won’t be able to record the dashboard. Once the zip file is downloaded, simply unzip and double click to start the Cypress application. It will start without the need for installing any dependencies.
Cypress installation is now complete. To more about Cypress, one can visit the official documentation of Cypress.