cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.82k stars 3.17k forks source link

The cypress npm package is installed, but the Cypress binary is missing error #21022

Closed MrinaliniPulidindi closed 1 year ago

MrinaliniPulidindi commented 2 years ago

Current behavior

I am using docker to install cypress and I am facing the below error every time I am doing Cypress verify.

"The cypress npm package is installed, but the Cypress binary is missing. We expected the binary to be installed here: /root/.cache/Cypress/9.5.3/Cypress/Cypress Reasons it may be missing:

Here is the docker code :

FROM docker.repo.frg.tech/cypress/base:14.16.0

RUN curl \
    jq

ENV CI=1

COPY package.json ./

RUN yarn install --frozen-lockfile

RUN npx cypress cache path
RUN npx cypress cache list
RUN npx cypress cache clear
RUN  DEBUG=cypress:cli,xvfb yarn cypress install
RUN npx cypress verify
COPY . .

Debug logs

RUN  DEBUG=cypress:cli,xvfb yarn cypress install
 ---> Running in 6a66dfe03836
yarn run v1.22.10
$ /node_modules/.bin/cypress install
cypress:cli NODE_OPTIONS is not set
cypress:cli parsed cli options {}
 cypress:cli installing with options {}
cypress:cli version in package.json is 9.5.3, version to install is 9.5.3
 cypress:cli Reading binary package.json from: /root/.cache/Cypress/9.5.3/Cypress/resources/app/package.json
cypress:cli no binary installed under cli version
cypress:cli checking local file /9.5.3 cwd /
cypress:cli preparing to download and unzip version  9.5.3 to path /root/.cache/Cypress/9.5.3
[STARTED] Task without title.
cypress:cli needed Cypress version: 9.5.3
cypress:cli source url https://download.cypress.io/desktop/9.5.3?platform=linux&arch=x64
 cypress:cli downloading cypress.zip to "/tmp/cypress-18.zip"
cypress:cli Downloading package {
  url: '[https://download.cypress.io/desktop/9.5.3?platform=linux&arch=x64'](https://download.cypress.io/desktop/9.5.3?platform=linux&arch=x64%27),
  proxy: 'http://proxy-infra.frg.tech:3128'/,
  downloadDestination: '/tmp/cypress-18.zip'
Done in 0.48s.
Removing intermediate container 6a66dfe03836
 ---> 39b6b7cd7736

Cypress Version

9.5.3

Package Manager

yarn

Operating system

Linux

Other

Platform: linux-x64 (Debian - 10.8)

T-e-j-k-u-m-a-r commented 2 years ago

@davidmunechika ,

I tried out below steps as well, Still the issue persists.

  1. Deleted cypress locally and globally
  2. npx cypress open
  3. Fresh install of latest 9.5.3
  4. Fresh install of older version 8.5.0, 8.40
MrinaliniPulidindi commented 2 years ago

@T-e-j-k-u-m-a-r , is it in your local setup or in a CI/CD pipeline

MrinaliniPulidindi commented 2 years ago

I was able to resolve the issue by changing our proxy settings. But still Cypress 9.5.3 dosen’t log the issue , I used Cypress 9.0.0 and then saw the actual issue with the binary download. Please update 9.5.3 to log the issues.

usinelogicielle commented 2 years ago

Hi @MrinaliniPulidindi ,

Can you specify what proxy settings did you change? For my concern, I write HTTP_PROXY and HTTPS_PROXY env. The URL works with curl but not with npm. And I have the same error than you Thx for your help

flamingoodev commented 2 years ago

I have the same error in my CI/CD pipeline.

colcherica commented 1 year ago

I have the same issue and I'm running locally my jenkins: image

colcherica commented 1 year ago

I manage to fix this issue by adding the npm cypress install as first build step into project config and after add the second build step in order to start your build image

texpatnyc commented 1 year ago

I'm having this same exact issue trying to build from my M1 mac. When trying to run this from an Intel Mac, everything works just fine. Is there something different that needs to be done for the arm version? I've tried everything in the documentation for this and even tried using buildx to do a multi-platform build like I do for all our other internal images.

yulian252003 commented 1 year ago

This happens in my Ubuntu when I try to configure Cypress in Jenkins locally.

cypressautomation@1.0.0 test node_modules/.bin/cypress run --browser chrome

The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /var/lib/jenkins/.cache/Cypress/12.3.0/Cypress/Cypress

Reasons it may be missing:

Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.

Alternatively, you can run 'cypress install' to download the binary again. "We expected the binary to be installed here: /var/lib/jenkins/.cache/Cypress/12.3.0/Cypress/Cypress" How can I install the binary there? I don't understand.

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.

nvora commented 1 year ago

Facing the same issue while installing Cypress from the local binary through CYPRESS_INSTALL_BINARY variable.

Cypress.app is found under "/home/jenkins/.cache/Cypress/9.7.0/Cypress.app" but while running the cypress run command it throws error like "We expected the binary to be installed here: /home/jenkins/.cache/Cypress/9.7.0/Cypress/Cypress"

Why it's not looking for the correct path which would be "/home/jenkins/.cache/Cypress/9.7.0/Cypress.app"

pacion commented 4 months ago

Same error there, any fix?

msmosavar commented 1 month ago

Same problem with cypress v13.13.1 and v13.13.3... any fix?!

MikeMcC399 commented 1 month ago

@msmosavar

You've replied to a closed issue for a legacy version of Cypress on a version of a Cypress Docker image which is no longer supported.

If you are having difficulty installing a current version of Cypress, you can try

export DEBUG=cypress:*
npx cypress install

or similar, depending on which operating system / package manager you are using, to get debug information. If it is still unclear how to solve your installation issue you can reach out to the Cypress technical community on Discord for advice:

Discord chat (click on button)

If you think that you have hit a bug in Cypress, then you can open a new issue here in the issues list https://github.com/cypress-io/cypress/issues