Installing Cypress
What you'll learn
- How to install Cypress via
npm
- How to install Cypress via direct download
- How to version and run Cypress via
package.json
System requirements
Operating System
Cypress is a desktop application that is installed on your computer. The desktop application supports these operating systems:
- macOS 10.9 and above (64-bit only)
- Linux Ubuntu 12.04 and above, Fedora 21 and Debian 8 (64-bit only)
- Windows 7 and above (64-bit only)
Node.js
If you're using npm
to install Cypress, we support:
- Node.js 12 or 14 and above
Linux
If you're using Linux, you'll want to have the required dependencies installed on your system.
Ubuntu/Debian
apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
CentOS
yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-devel GConf2 nss libXScrnSaver alsa-lib
Docker
Docker images with all of the required dependencies installed are available under cypress/base
If you're running your projects in containers, then you'll want Cypress in the container with the Node.js process.
ui:
image: cypress/base:latest
# if targeting a specific node version, use e.g.
# image: cypress/base:14
cypress/base
is a drop-in replacement for
base docker node images.
Installing
npm install
Install Cypress via npm
:
cd /your/project/path
npm install cypress --save-dev
This will install Cypress locally as a dev dependency for your project.
Make sure that you have already run
npm init
or have a node_modules
folder or
package.json
file in the root of your project to ensure cypress is installed
in the correct directory.
Notice that the Cypress npm
package is a wrapper around the Cypress binary.
The version of the npm
package determines the version of the binary
downloaded. As of version 3.0
, the binary is downloaded to a global cache
directory to be used across projects.
System proxy properties http_proxy
, https_proxy
and no_proxy
are respected
for the download of the Cypress binary. You can also use the npm properties
npm_config_proxy
and npm_config_https_proxy
. Those have lower priority, so
they will only be used if the system properties are being resolved to not use a
proxy.
Best Practice
The recommended approach is to install Cypress with npm
because:
- Cypress is versioned like any other dependency.
- It simplifies running Cypress in Continuous Integration.
yarn add
Installing Cypress via yarn
:
cd /your/project/path
yarn add cypress --dev
System proxy properties http_proxy
, https_proxy
and no_proxy
are respected
for the download of the Cypress binary.
Direct download
If you're not using Node or npm
in your project or you want to try Cypress out
quickly, you can always
download Cypress directly from our CDN.
Recording runs to the Dashboard is not possible from the direct download. This
download is only intended as a quick way to try out Cypress. To record tests to
the Dashboard, you'll need to install Cypress as an npm
dependency.
The direct download will always grab the latest available version. Your platform will be detected automatically.
Then you can manually unzip and double click. Cypress will run without needing to install any dependencies.
Direct downloading for old versions
It is possible to download an old version from our CDN by suffixing the URL with the desired version (ex. https://download.cypress.io/desktop/6.8.0).
Continuous integration
Please read our Continuous Integration docs for help installing Cypress in CI. When running in linux you'll need to install some system dependencies or you can use our Docker images which have everything you need prebuilt.
Advanced Installation
If you have more complex requirements, want to level-up your Cypress workflow or just need help with troubleshooting, check out our Advanced Installation reference.
Next Steps
Open the app and take it for a test drive!