question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CircleCI :: Cypress Binary Download Fails

See original GitHub issue

Current behavior:

Cypress fails to download the binary when running yarn install on CircleCI:

yarn install v1.15.2
warning package.json: No license field
warning No license field
[1/5] Validating package.json...
warning No license field
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cypress/code-coverage@1.4.0" has unmet peer dependency "nyc@*".
warning " > @cypress/code-coverage@1.4.0" has unmet peer dependency "istanbul-lib-coverage@*".
[5/5] Building fresh packages...
error /workspace/core-products/Divi/core/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments: 
Directory: /workspace/core-products/Divi/core/node_modules/cypress
Output:
Installing Cypress (version: 3.4.0)

[03:33:58]  Downloading Cypress     [started]
[03:33:59]  Downloading Cypress     [failed]
The Cypress App could not be downloaded.

Please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/3.4.0?platform=linux&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 92ead24d077815fc02b8a42fba398cd9136f79fc8b6f2a07fe3f7137b365087b34039397bcda195b62db3da3e98643bf9647519e96b46eecfb243ca198d0d0c2
Computed checksum: b8f24b6c391bb66b2636764630145cf976139ec3208b795051fca3957c5ef932c4047257d6d271df1302a8c2d0eec800640beb60bceecfaabd951850d717f894

Expected downloaded file to have size: 141130568
Computed size: 148305408

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.4.0

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Steps to reproduce: (app code and test code)

  1. Run yarn install on CircleCI

Versions

Cypress 3.4.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
bkoltaicommented, Dec 16, 2019

Here is how I resolved my Error: Corrupted download issue on CircleCI:

Following some suggestions here, I checked to see what versions of cypress I was dependent on using yarn why cypress. This showed that I indeed had 2 different versions. I then added the following to my package.json to pick the version I wanted

  "resolutions": {
    "cypress": "3.8.0"
  }

When I re-ran yarn why cypress I saw only 1 version. The build then passed.

Hope this helps others who come across this issue!

9reactions
joekrumpcommented, Aug 16, 2019

@lots0logs, perhaps this is a bug in the Cypress code, however, I think the cause of the issue stems a bit from the use of yarn for package management. I think I’ve resolved the issue and here’s what I did:

  1. Checked the yarn.lock file in my project and observed that I had several entries for cypress and they pointed to different versions.
  2. Updated various dependencies so that any dependency that had cypress as a subdependency ended up resolving to the same version of cypress (in my case 3.4.1).

Outcome

I now have a single entry for cypress in my yarn.lock file which resolves to the version of cypress that I’ve specified in my package.json file (3.4.1 for me). Here’s what this looks like. I hope this helps:

cypress@3.4.1, cypress@^3.1.5:
  version "3.4.1"
  resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.4.1.tgz#ca2e4e9864679da686c6a6189603efd409664c30"
  integrity sha1-yi5OmGRnnaaGxqYYlgPv1AlmTDA=
  dependencies:
    "@cypress/listr-verbose-renderer" "0.4.1"
    "@cypress/xvfb" "1.2.4"
    arch "2.1.1"
    bluebird "3.5.0"
    cachedir "1.3.0"
    chalk "2.4.2"
    check-more-types "2.24.0"
    commander "2.15.1"
    common-tags "1.8.0"
    debug "3.2.6"
    execa "0.10.0"
    executable "4.1.1"
    extract-zip "1.6.7"
    fs-extra "5.0.0"
    getos "3.1.1"
    is-ci "1.2.1"
    is-installed-globally "0.1.0"
    lazy-ass "1.6.0"
    listr "0.12.0"
    lodash "4.17.15"
    log-symbols "2.2.0"
    minimist "1.2.0"
    moment "2.24.0"
    ramda "0.24.1"
    request "2.88.0"
    request-progress "3.0.0"
    supports-color "5.5.0"
    tmp "0.1.0"
    url "0.11.0"
    yauzl "2.10.0"
Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - CircleCI Developer Hub
Runs all Cypress tests without recording results on the Dashboard. Installs dependencies with "npm ci", caches NPM modules and Cypress binary. 1 ...
Read more >
Advanced Installation | Cypress Documentation
CYPRESS_INSTALL_BINARY, Destination of Cypress binary that's downloaded and installed ; CYPRESS_DOWNLOAD_MIRROR, Downloads the Cypress binary through a mirror ...
Read more >
How to resolve "The cypress npm package is installed, but the ...
cache/Cypress - You ran 'npm install' at an earlier build step but did not persist: /root/.cache/Cypress Properly caching the binary will fix ...
Read more >
cypress-io/cypress - Gitter
Properly caching the binary will fix this error and avoid downloading and unzipping Cypress. Alternatively, you can run 'cypress install' to download the ......
Read more >
Debugging Pipeline Issues With Cypress - Marie Cruz
The issue that I encountered was about a missing Cypress binary. To give you a background of our build pipeline, we have a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found