Last updated: Apr 5, 2024
Reading time·3 min
The error "Cypress verification timed out after 30000 milliseconds" occurs when the Cypress verification process times out.
Use the npx cypress verify
command to resolve the issue or increase your
timeout by setting the CYPRESS_VERIFY_TIMEOUT
environment variable.
Here is the complete stack trace.
It looks like this is your first time using Cypress Verifying Cypress can run Cypress verification timed out. This command failed with the following output: ------- Command timed out after 30000 milliseconds ------- Platform: win32 Cypress version:
npx cypress verify
command to solve the errorOne way to solve the error is to use the npx cypress verify
command.
Open your terminal in your project's root directory (where your package.json
file is) and run the following command.
npx cypress verify
The command verifies that Cypress is installed correctly and is executable.
The cypress open
or cypress run
commands execute the cypress verify
command under the hood.
CYPRESS_VERIFY_TIMEOUT
environment variable if the issue persistsIf the error persists, the verification process might be timing out.
The default timeout is set to 30 seconds (=30000 milliseconds).
You can set the CYPRESS_VERIFY_TIMEOUT
environment variable to increase the
timeout.
For example, if you are on macOS or Linux, issue the following command in bash
or zsh
.
# macOS or Linux export CYPRESS_VERIFY_TIMEOUT=100000
If you are on Windows and use CMD, use the following command instead.
# Windows CMD set CYPRESS_VERIFY_TIMEOUT=100000
If you are on Windows and use PowerShell, use the following command instead.
# Windows PowerShell $env:CYPRESS_VERIFY_TIMEOUT=100000
The command sets the verification timeout to 100000 milliseconds (100 seconds).
After you increase the verification timeout to 100 seconds, issue the
npx cypress verify command
.
npx cypress verify
If the issue persists, try to relaunch Cypress by issuing the cypress run
or
cypress open
command once again.
package.json
fileAnother thing you can try is to set the environment variable in your
package.json
file, immediately before issuing cypress open
or cypress run
.
Open your terminal and install the cross-env package.
# 👇️ with NPM npm install cross-env # 👇️ with YARN yarn add cross-env
Now set the CYPRESS_VERIFY_TIMEOUT
environment variable in your NPM script,
right before issuing the cypress command.
{ "scripts": { "cypress": "cross-env CYPRESS_VERIFY_TIMEOUT=100000 && cypress run --e2e", "cypress:open": "cross-env CYPRESS_VERIFY_TIMEOUT=100000 && cypress open --e2e" } }
Now you should be able to run the cypress
and cypress:open
commands without
getting a verification timeout.
If you still get the error, try to clean your NPM cache.
npm cache clean --force
Try to rerun the cypress run
or cypress open
command after clearing your
cache.
After you've increased your verification timeout sufficiently, the error should be resolved.
You can learn more about the related topics by checking out the following tutorials: