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.

Action fails, because "Cannot find cached binary under /home/runner/.cache/CypressCache/8.2.0/Cypress/Cypress"

See original GitHub issue

Error

We haven’t changed anything in our workflow settings, but we get suddenly:

We expected the binary to be installed here: /home/runner/.cache/CypressCache/8.2.0/Cypress/Cypress

History

On 1. December our CI Pipeline went through successfully.

On 2. December the Pipeline failed. But we haven’t changed anything in our .github/workflows folder. Only some application code changed.

Our e2e.yaml

name: Cypress Tests

on: [push]

env:
  HTTPS: 'true'
  # some more envs....

jobs:
  cypress:
    name: Cypress
    runs-on: ubuntu-latest
    env:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          build: npm run build
          start: npm start

      - name: Upload videos
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: cypress-videos
          path: cypress/videos
Log / Last time successful (Dec. 1.)
Run cypress-io/github-action@v2
  with:
    build: npm run build
    start: npm start
    record: false
    config-file: cypress.json
  env:
    HTTPS: true
   ... 
/usr/local/bin/npm ci

> core-js@2.6.12 postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> ejs@2.7.4 postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/ejs
> node ./postinstall.js


> fsevents@1.2.13 install /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js


Skipping 'fsevents' build as platform linux is not supported

> fsevents@1.2.13 install /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js


Skipping 'fsevents' build as platform linux is not supported

> core-js@3.13.1 postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js-pure@3.13.0 postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> cypress@8.2.0 postinstall /home/runner/work/lock-book-auth-web/lock-book-auth-web/node_modules/cypress
> node index.js --exec install

Note: Overriding Cypress cache directory to: /home/runner/.cache/Cypress

      Previous installs of Cypress may not be found.

Installing Cypress (version: 8.2.0)

[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.
[STARTED] Task without title.
[SUCCESS] Task without title.

You can now open Cypress by running: node_modules/.bin/cypress open

https://on.cypress.io/installing-cypress

added 2125 packages in 38.899s
/usr/local/bin/npx cypress cache list
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ version β”‚ last used    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 8.2.0   β”‚ 4 months ago β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
/usr/local/bin/npx cypress verify

[STARTED] Task without title.
[SUCCESS] Task without title.
Log / Last first time failed (Dec. 2.)
Run cypress-io/github-action@v2
  with:
    build: npm run build
    start: npm start
    record: false
    config-file: cypress.json
  env:
    HTTPS: true
    ...
/usr/local/bin/npm ci

added 2102 packages, and audited 2103 packages in 42s

... 

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
/usr/local/bin/npx cypress cache list
No cached binary versions were found.
/usr/local/bin/npx cypress verify
The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /home/runner/.cache/Cypress/8.2.0/Cypress/Cypress

Reasons it may be missing:

- You're caching 'node_modules' but are not caching this path: /home/runner/.cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /home/runner/.cache/Cypress

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.

https://on.cypress.io/not-installed-ci-error

----------

Platform: linux (Ubuntu - 20.04)
Cypress Version: 8.2.0
Error: The process '/usr/local/bin/npx' failed with exit code 1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
NorbertNadercommented, Jan 14, 2022

I had to install cypress from node_modules. This is what my step looks like now:

      - name: Install and Build
        run: |
          yarn install
          yarn build
          ./packages/core/node_modules/cypress/bin/cypress install

We have a monorepo setup, hence /packages/core/.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test fails because it doesn't find the Cypress binary - GitLab
Cypress cache is located in /root/.cache/Cypress and GitLab won't let you cache anything outside the working directory. To fix the problemΒ ...
Read more >
Running cypress in GithubActions on windows environment
I tried with actions/cache and was still getting the same error. I fixed this by doing two things: 1- Specify Cypress binary cache...
Read more >
Advanced Installation | Cypress Documentation
Now Cypress will skip its install phase once the npm module is installed. Binary cache. As of version 3.0 , Cypress downloads the...
Read more >
@cypress/github-action - npm
For example, if you cannot share the Node modules across Node versions due to native extensions. In that case pass your own cache-key...
Read more >
caching cypress binaries in github actions - Enrico Teterra
To setup caching, you will want to cache both the node_modules folder as well as the folder where cypress keeps its binary...
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