Skip to main content

How to update Cypress

Well, it's time to upgrade our cypress to the latest version. In this article, we will see how to update cypress to the latest version. EVERY 6 to 8 weeks, there is a significant update that will be rolled out with some changes.

How to check Cypress changelog and latest version

Open Cypress Application using any of below command

#The long way with the full path
$ ./node_modules/.bin/cypress open

# shortcut using npm bin
$(npm bin)/cypress open

#Using npx, note: npx is included with npm > v5.2 or can be installed separately.
$ npx cypress open

how to update cypress version

At the bottom you can see we got the notification for an updated version (8.4.1) is available and current version 6.5.0 and also the link for changelog.

Check Changelog: Click on Changelog in bottom or navigate to this link to view the change logs.  Here you can view the bug fixes, performance fixes and features etc.

How to check Cypress changelog

Latest version you will find at the top of the list with release date. You can jump to the specific version by clicking on the links on the right side.

When you will click on Learn More or current version you will see below popup.

how to update cypress version

How to update Cypress to latest version

Method 1: Update Cypress Using NPM

Step 1: Close the cypress

Step 2: Type below command

npm install --save-dev cypress@8.4.0

Step 3: Check Cypress version

$ npx cypress --version

Method 2: Using package.json

In package.json file you will find ~ or ^ sign before dependency. Don't worry if you have no idea of this we will discuss this in more detail later.

Step 1: First, close the cypress.

Step 2: Navigate to your package.json.

Step 3: Change the cypress version to the current updated version in package.json

how to update cypress version

Step 4: type below command

$ npx install cypress

Step 5: Check cypress version

$ npx cypress --version

Method 3: Update Cypress Using Yarn

yarn upgrade cypress@5.12.0

Now opens your terminal and type in : 

npm i

voila, after some installations, you should have your cypress upgraded to the latest version.

Tags
Submitted by arilio666 on September 22, 2021

Ashwin is working with iVagus as a Technical Lead. He has experience in various technologies like Cypress, JavaScript, TypeScript, Rest Assured, Selenium, Cucumber, and Java.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.