cypress-io / github-action

GitHub Action for running Cypress end-to-end & component tests

Home Page:https://on.cypress.io/guides/continuous-integration/github-actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed on running action with node version 18.18.1

lucasbatier opened this issue · comments

Here is the error message on my github actions:

The engine "node" is incompatible with this module. Expected version "18.18.1". Got "18.18.0"

Here is the workflow file

name: Manual Cypress Tests

on:
    workflow_dispatch:

jobs:
    cypress-run:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout
              uses: actions/checkout@v4

            - name: Cypress run
              uses: cypress-io/github-action@v6
              env:
                  CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
              with:
                  config: "viewportWidth=${{ matrix.viewport[0] }},viewportHeight=${{ matrix.viewport[1] }}"
                  browser: ${{ matrix.browser }}
                  group: ${{ matrix.browser }}-${{ matrix.viewport[0] }}x${{ matrix.viewport[1] }}
                  build: yarn run build
                  start: yarn start_dev
                  wait-on: "http://localhost:3000"
                  wait-on-timeout: 300
                  record: true
                  parallel: true
        strategy:
            matrix:
                browser: [chrome, firefox, edge]
                viewport: [[1920, 1080], [375, 667]]
                include:
                    - browser: chrome
                    - viewport: [1920, 1080]

Here is the beggining of the package.json file

{
  "name": "vadimap-client-platform",
  "version": "2.0.0",
  "private": true,
  "engines": {
    "node": "^18.18.0"
  },
  ...
}

@lucasbatier

I expect that the error message

The engine "node" is incompatible with this module. Expected version "18.18.1". Got "18.18.0"

is coming from executing

yarn --frozen-lockfile

Your workflow is running on ubuntu-latest which is equivalent to ubuntu-22.04. This currently has a default version of Node.js 18.18.0 (see the Language and Runtime section).

Your yarn.lock file is specifying that it must have Node.js 18.18.1 and that condition is not met by the GitHub runner image which is supplying 18.18.0.

I suggest you check the contents of your yarn.lock file.

If you cannot find the problem, then please post your full package.json and yarn.lock files and the full log from GitHub Actions.

If you must have Node.js 18.18.1, then you can specify this in the workflow with actions/setup-node and this will override the default version of Node.js provided by the runner.

@lucasbatier

Were you able to check this out?

Closing due to lack of response.