Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run Cypress Open

Tags:

cypress

I recently took over a cypress project; running on windows. The first time I installed, all was working. Now, subsequent to upgrading node/electron/chrome, I can't open cypress with any command. Here's what I tried:

  • Delete node_modules directory in my project.
  • npm init Answered with all defaults. node_modules directory is present but empty.
  • npm install cypress --save-dev (from [the doc][1]). This populated my node_modules, but installed cypress in my account (users) directory.
  • node_modules\.bin\cypress open That reported:
    • It looks like this is your first time using Cypress: 3.1.1
    • Verified Cypress: [in my users dir]
    • Opening Cypress...

At that point I can see cypress in my process list, but the UI never shows. I can run headless tests normally, so I'm OK from a CI perspective, but I still want to open the UI with my tests locally. I can launch the cypress executable in my user dir and then open my project root directory manually, but can't run an open command normally. The scripts section of package.json doesn't seem to be designed to accept a path to an exe with params.

Is there another way to call open that I'm missing?

like image 352
dudeNumber4 Avatar asked Jan 02 '23 15:01

dudeNumber4


1 Answers

Solution: Go to your project directory which you installed cypress, in your package.json update the cypress version to the latest , look at the releases versions link, or just install the latest from cli:

npm install cypress@latest --save-dev

Reopen again and verify:

./node_modules/.bin/cypress open
//OR
npx cypress open
like image 98
avivamg Avatar answered Jan 05 '23 17:01

avivamg