Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No version of Cypress is installed #2610

Closed
jmargolisvt opened this issue Oct 15, 2018 · 83 comments
Closed

No version of Cypress is installed #2610

jmargolisvt opened this issue Oct 15, 2018 · 83 comments

Comments

@jmargolisvt
Copy link

jmargolisvt commented Oct 15, 2018

Current behavior:

I've installed Cypress successfully, but when I try to run it with cypress open I get:

No version of Cypress is installed in: /Users/ddcbethanyr/Library/Caches/Cypress/3.1.0/Cypress.app

Please reinstall Cypress by running: cypress install

Cypress executable not found at: /Users/ddcbethanyr/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress

Desired behavior:

cypress open should open Cypress

Steps to reproduce:

npm i cypress
cypress open

Versions

Cypress 3.1.0
Node 8.12.0
OSX High Sierra

@jennifer-shehane
Copy link
Member

Does it work after running cypress install?

@jmargolisvt
Copy link
Author

No it doesn't. The only way I've been able to get around it is to install it globally. Works for the day, but need to reinstall it all over again the next day.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Oct 15, 2018
@kuceb
Copy link
Contributor

kuceb commented Oct 15, 2018

@jmargolisvt what output do you get with cypress install ? What about cypress install --force ?

@jmargolisvt
Copy link
Author

Both commands yield -bash: cypress: command not found Again, it worked for the day yesterday when I globally installed, now it appears to be gone again today. Very strange.

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt just like any other node module, you'll have to execute cypress from the ./node_modules/.bin directory. Can you try running:

./node_modules/.bin/cypress install

@jmargolisvt
Copy link
Author

Yes, that will install cypress and it will work for the moment. Restart the computer, and it's gone again, back to the original error message.

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt it looks like Cypress was installed as a different user, ddcbethanyr instead of jeff. Which user did you expect Cypress to install for?

@jmargolisvt
Copy link
Author

Sorry, mixed that up. They are both for the same user. It's my coworker that's having this issue (edited my first post).

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt ok, I would see if the entire /Users/ddcbethanyr/Library/Caches/ directory is being cleared on reboot.

@jmargolisvt
Copy link
Author

It is not being cleared on reboot. Still plenty of stuff in there, just not Cypress.

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt so cypress cache exists before reboot, but is gone after?

@jmargolisvt
Copy link
Author

That is correct.

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt well I'm not sure why that would be the case...can you check the permissions of the cypress cache folder after the binary is installed? for example with ls -lha

@jmargolisvt
Copy link
Author

$ ls -lha
total 0
drwxr-xr-x   4 ddcbethanyr  avdefs   128B Oct 17 13:16 .
drwx------+ 42 ddcbethanyr  avdefs   1.3K Oct 17 14:44 ..
drwxr-xr-x   3 ddcbethanyr  avdefs    96B Oct 17 12:54 3.1.0
drwx------@  3 ddcbethanyr  avdefs    96B Oct 17 13:16 cy

Anything look wrong here?

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt i'd compare that to other items in Library/Caches, see if there's any obvious differences

@jmargolisvt
Copy link
Author

I have the same permissions on my machine (which works correctly).

total 0
drwxr-xr-x   4 jmargolis  MAN\Domain Users   128B Aug 20 13:21 .
drwx------+ 61 jmargolis  MAN\Domain Users   1.9K Oct 15 15:00 ..
drwxr-xr-x   3 jmargolis  MAN\Domain Users    96B Aug 20 13:14 3.1.0
drwx------@  3 jmargolis  MAN\Domain Users    96B Aug 20 13:21 cy

@kuceb
Copy link
Contributor

kuceb commented Oct 17, 2018

@jmargolisvt well, I don't know what Cypress can do about the binary disappearing...this is seemingly something very specific to your co-workers system. They can try exporting CYPRESS_CACHE_FOLDER to somewhere else on their computer.

@lcastanedaCV
Copy link

I have the same issue.
I even changed the CYPRESS_CACHE_FOLDER to c:/ and is not working
Any ideas?

@jennifer-shehane
Copy link
Member

Unfortunately we'll have to close this issue if no reproducible example is provided. Can anyone provide a way to reproduce this?

@sergioblanco86
Copy link

sergioblanco86 commented Dec 14, 2018

Hi there, I managed to install cypress and run the tests locally, but now I want to run the project and the terminal shows me cypress: command not found, don't know why! PLEASE, help!

@sergioblanco86
Copy link

Solved, I run it with the command
$(npm bin)/cypress run

@kuceb kuceb closed this as completed Dec 17, 2018
@jennifer-shehane jennifer-shehane removed the stage: needs investigating Someone from Cypress needs to look at this label Dec 19, 2018
@hellfireSteve
Copy link

Closing an unsolved issue is a cop out - even if you cannot reproduce it.

@kuceb
Copy link
Contributor

kuceb commented Jan 22, 2019

@hellfireSteve I see where you're coming from, however without a reproducible or further feedback on the issue, we can't be certain this actually is a problem with cypress.

@gracenoah
Copy link

We've been seeing this issue in CI for as long as we've been using cypress.

No version of Cypress is installed in: /var/lib/buildkite-agent/.cache/Cypress/3.1.0/Cypress
--
  |  
  | Please reinstall Cypress by running: cypress install
  | ----------
  |  
  | Cypress executable not found at: /var/lib/buildkite-agent/.cache/Cypress/3.1.0/Cypress/Cypress
  | ----------
  |  
  | Platform: linux (Debian - 8.11)
  | Cypress Version: 3.1.0
./node_modules/.bin/cypress install

doesn't fix the issue:

  | Cypress 3.1.0 is already installed in /var/lib/buildkite-agent/.cache/Cypress/3.1.0
  |  
  | Skipping installation:
  |  
  | Pass the --force option if you'd like to reinstall anyway.

The directory exists but the binary is missing:

$ ls Cypress/
content_shell.pak  icudtl.dat  libffmpeg.so  LICENSES.chromium.html  locales  natives_blob.bin  resources  version  views_resources_200_percent.pak

@gracenoah
Copy link

gracenoah commented Apr 4, 2019

Looking at this particular agent's history, I see that in an earlier run the job was killed part way through while running yarn install:

yarn install v1.13.0
--
  | [1/4] Resolving packages...
  | [2/4] Fetching packages...
  | <lots of warnings>
  | [4/4] Building fresh packages...
  | # Received cancellation signal
  | Error: The command was interrupted by a signal

@dylanbromby
Copy link

Same exact experience on latest macOS Mojave. Been happening for a while. Install works - within a day or so - same error.

@craig10
Copy link

craig10 commented Apr 16, 2019

I am also having the same issue. I can run on my local mac, but when I push to the cloud I get:

No version of Cypress is installed in: /home/vcap/app/~/Library/Caches/Cypress/3.2.0/Cypress

I realize this issue is closed - I can open a new one if necessary. Looking for suggestions on how to resolve this issue.

@dwesty17
Copy link

@bkucera @jennifer-shehane any updates? We've had to stop using Cypress in our CI pipeline.

@simkessy
Copy link

simkessy commented Mar 6, 2021

This works fine when I build the image locally but fails when in BuildKite

@jennifer-shehane
Copy link
Member

@dwesty17 Typically the reason for this message is that the previously installed version cannot be found at the cache location. This may be because your CI setup or some other factor (like a virus software) has cleared the cache directory. It's hard to say without seeing your setup. We have Cypress run quite frequently in GitHub actions with many examples here: https://github.com/cypress-io/github-action

@chicoluz10
Copy link

I've had the same problem on a Windows 10 Home Single Language (Version: 20H2)

Installed cypress yesterday for the first time, it worked fine. Come morning, I boot my PC up and cannot run cypress

image

Running a './node_modules/.bin/cypress install' fixed the issue, but according to this forum, on the morrow I am to see this again.

@agarcialaika
Copy link

I was having the same issue in Ubuntu 20.

After installing Node.js and running the command to download cypress:
npm install cypress --save-dev

You have to run this command:
node_modules/.bin/cypress install

You have to wait to the installation is completed and after that you will be able to run the open command:
node_modules/.bin/cypress open

In my case, all of that worked.

Good luck

@devzom
Copy link

devzom commented Apr 17, 2021

Most of the time this way works:
delete -> ./node_modules/.bin/cypress folder

@intermx-manju
Copy link

intermx-manju commented May 3, 2021

Hi Team,

iPS F:\Cypress\abx> ./node_modules/.bin/cypress run
No version of Cypress is installed in: C:\Users\Aaaa-ATL028\AppData\Local\Cypress\Cache\6.9.1\Cypress

Please reinstall Cypress by running: cypress install


Cypress executable not found at: C:\Users\Aaara-ATL028\AppData\Local\Cypress\Cache\6.9.1\Cypress\Cypress.exe


Platform: win32 (10.0.19042)
Cypress Version: 6.9.1

@intermx-manju
Copy link

@jennifer-shehane can you please respond?

@VictorMachimana
Copy link

VictorMachimana commented Aug 13, 2021

Removing the cypress npm package and re-installing it worked for me.
"npm remove cypress" then "npm i cypress"

@mmi-d
Copy link

mmi-d commented Sep 2, 2021

Faced the same issue. I figured out that I had the latest cypress version installed on my PC (8.3.1) but my work project was using an older version (5.6.0). The following solved the problem for me:

Cypress installation - ./node_modules/.bin/cypress install

Cypress run - ./node_modules/.bin/cypress open

@shan-du
Copy link

shan-du commented Oct 5, 2021

It's been 3 years, and this issue still exists :(

Setup

System: MacOS v11.3.1.
package.json:

"devDependencies": {
    "cypress": "^7.5.0",
    ...
}

Steps to Reproduce:

  1. npm i
  2. cypress open
  3. received the following error:
No version of Cypress is installed in: /Users/shan/Library/Caches/Cypress/7.5.0/Cypress.app

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /Users/shan/Library/Caches/Cypress/7.5.0/Cypress.app/Contents/MacOS/Cypress

----------

Platform: darwin (20.4.0)
Cypress Version: 7.5.0
  1. cypress install
  2. received this error: zsh: command not found: cypress

Temporary Solution

As folks suggested here, running this command ./node_modules/.bin/cypress install does fix it, but as also being pointed out here, it might fail again after a restart.

Personally I have not seen other executable Node modules having this problem so this is likely specific to Cypress & really hope you guys can re-open & investigate this issue, I'd be happy to provide more details if needed.
cc: @jennifer-shehane @bkucera

@sh-dv
Copy link

sh-dv commented Nov 30, 2021

Basically the issue is that the Cypress electronJS app cache is not found on your system. Maybe due to cache clearing.

To solve this issue, you need to install cypress again on your system. but the trick is that you don't do it from the app directory you are working on :

  1. create new directory. example : newFolder on Desktop
  2. open the new directory in terminal
  3. install cypress which have the exact version in your app. example npm install cypress@8.5.0
  4. after install is successful, go back to your app directory and run the test. example: cypress open

This should work for long term. even after restart.

For temporary solution run :
./node_modules/.bin/cypress install

@ifrim
Copy link

ifrim commented Dec 17, 2021

What worked for me:

> rm -rf ~/.cache/Cypress/<version-from-the-error-here>/
> npm cache clear -f
> npm i cypress -D
> node_modules/.bin/cypress install

@blindfish3
Copy link

I hit this issue because of a failure during the initial install. The .cache/Cypress/[version] folder had been created and when I tried cypress install to rectify the error it told me it was already installed. I had to delete the cache and run install to resolve the issue.

Maybe cypress install should do a more thorough check of a previous installation before claiming it is installed?

@kapowaz
Copy link

kapowaz commented Mar 15, 2022

I’d like to add I also experienced this problem, running on a Mac with macOS Monterey 12.2.

Listing the contents of ~/Library/Caches/Cypress showed that I had several previous versions of Cypress installed there, but not the version my project now used (9.5.1). Running both npx cypress install and ./node_modules/.bin/cypress install had the same outcome: the installer hung, without ever doing anything.

As per the suggestion above I created a parallel project with just cypress@9.5.1 as a dependency, and then ran ./node_modules/.bin/cypress install from there. Interestingly this then created the directory within ~/Library/Caches/Cypress, whilst the still-running cypress install from my main project continued to hang.

I don't have CleanMyMac (or indeed much other third-party software) installed since this is a corporate machine which is fairly locked-down, so I'd encourage re-opening this ticket. It seems highly likely there is a bug in the install script which causes it to hang or fail for some unreported reason.

@tux-o-matic
Copy link

For those having this issue in containers, have a look at the XDG_CACHE_HOME ENV variables. It should point to a persistent volume so the Electron cache will be preserved for future run.

@9a-aaaaaaaa
Copy link

./node_modules/.bin/cypress install What is the function of executing this command? PNPM I cypress -- save-dev It took a long time to execute the command.

@nischaytv
Copy link

To solve this in a simple way execute the below commands in order

npm uninstall -D cypress -g
npm install cypress
npx cypress install --force

You can thank me later..

@stankolubomir
Copy link

We are using just slightly modified conditional script for CI and local development

if ! npx cypress verify >/dev/null 2>&1; then
    npx cypress install --force
fi

@sutapaGanguly
Copy link

sutapaGanguly commented Aug 21, 2022

The same issue is faced when I opened an exported folder in VS code.
Tried to install cypress using command npm install cypress --save -dev > failed with below error>

No version of Cypress is installed in: /Users/sutapaganguly/Library/Caches/Cypress/7.5.0/Cypress.app

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /Users/sutapaganguly/Library/Caches/Cypress/7.5.0/Cypress.app/Contents/MacOS/Cypress

----------

Platform: darwin (19.6.0)
Cypress Version: 7.5.0

After that, it successfully installed when I followed > ./node_modules/.bin/cypress install.

@Alfredo-Perficient
Copy link

To solve this in a simple way execute the below commands in order

npm uninstall -D cypress -g
npm install cypress
npx cypress install --force

You can thank me later..

Thanks! this was helpful!!

@blakemulnix
Copy link

I ran across the same or a similar issue. I think what was happening was that there were existing processes that had a lock on the Cypress executable file. When I tried to run Cypress it failed saying it wasn't installed. After killing all processes using the executable, things worked as expected.

@jerry-lllman
Copy link

To solve this in a simple way execute the below commands in order

npm uninstall -D cypress -g
npm install cypress
npx cypress install --force

You can thank me later..

Thanks!
npx cypress install --force
it's effective !!!

@ZainabArbisoft
Copy link

I am facing this issue, everytime I open project, it says cypress is not installed. Here is the screenshot
image

@holasoymas
Copy link

When I do cypress install it is just displaying Installing cypress only and I can't find node_nodules folder in .cache/Cypress forlder
cypress_err

@walidmokhtari
Copy link

I've deleted the node_modules and it worked for me

@mischah
Copy link

mischah commented Jun 10, 2024

Stumbled upon this issue.

Fixed with adding the following postinstall lifecylce script in my package.json

  "scripts": {
    "test": "cypress run",
    "test:open": "cypress open",
    "postinstall": "cypress install"
  }

@mshamaseen
Copy link

I needed to use npx node_modules/cypress run instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests