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.

Runner externals Node.js version v16.13.0 always used in GHA runs

See original GitHub issue

Description

When github-action is run, the version of Node.js which the Cypress log shows is being used (v16.13.0) is neither the installed version (18.12.1), nor the default version for the runner (v16.18.1).

Cypress shows: v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node) Default Node.js in runner ubuntu-22.04 runner: v16.18.1 Installed Node.js: 18.12.1 Found in cache @ /opt/hostedtoolcache/node/18.12.1/x64

Steps to reproduce

Environment: GitHub runner: ubuntu-22.04 Node.js: lts/hydrogen (18.12.1) Cypress: 11.2.0 github-action: v5.0.0

Run action with following core instructions:

    runs-on: ubuntu-22.04
    env:
      NO_COLOR: true
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Setup Node.js 18 environment
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/hydrogen'
      - name: Cypress run
        uses: cypress-io/github-action@v5.0.0
        with:
          spec: cypress/e2e/spec.cy.js

Note that the log shows

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Cypress:        11.2.0                                                                         β”‚
  β”‚ Browser:        Electron 106 (headless)                                                        β”‚
  β”‚ Node Version:   v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node)              β”‚
  β”‚ Specs:          1 found (spec.cy.js)                                                           β”‚
  β”‚ Searched:       cypress/e2e/spec.cy.js                                                         β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The log shows Node.js version v16.13.0 being used by Cypress, although v18.12.1 was installed before the github-action was called.

Example action to reproduce

Action log file

Expectation

The action should use the Node.js version installed by actions/setup-node@v3 - in this case 18.12.1 - and not Node.js v16.13.0.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaffrepaulcommented, Dec 7, 2022

Thanks for the legwork @MikeMcC399

0reactions
MikeMcC399commented, Dec 11, 2022

There was a breaking change in Cypress 9.0.0, released Nov 10, 2021:

https://docs.cypress.io/guides/references/changelog#9-0-0

"The nodeVersion configuration option now defaults to system. The behavior of the system option has changed to always use the Node.js binary/version that launched Cypress. If Cypress was not launched via the terminal, Cypress will use the bundled Node.js version. This could change the behavior of code within your pluginsFile since it may be run in your system Node.js version. Addresses #18684.

The nodeVersion configuration option has been deprecated and will be removed in a future release.

The bundled Node.js version was upgraded from 14.17.0 to 16.5.0. This could change the behavior of code within the pluginsFile when using the bundled Node.js version of Cypress. Addressed in #18317."


Starting from version 9.0.0, when running github-action v5 under ubuntu-22.04 with Node.js: lts/hydrogen (18.12.1) installed, Cypress reports:

β€œNode Version: v16.13.0 (/home/runner/runners/2.299.1/externals/node16/bin/node)”

In Cypress version 8, the Node.js version was not reported in the results of running Cypress.


The issue remains that running Cypress through github-action always reports the externals version v16.13.0 whereas running Cypress in a workflow using npx cypress will report the Node.js version installed by the workflow e.g. 18.12.1. Reference to the documentation for github-action implies that the current behavior of github-action is a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

actions/setup-node - GitHub
The node-version input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify...
Read more >
GitHub-hosted runners now run Node.js 16 by default
In the latest update to our GitHub-hosted runners virtual environments, Node. js 16 has become the default version of node and npm 8...
Read more >
Worker threads | Node.js v19.3.0 Documentation
The node:worker_threads module enables the use of threads that execute JavaScript in parallel. To access it: const worker = require('node:worker_threads');.
Read more >
'npm' is not recognized as internal or external command ...
Just Download and Install Node.js from here https://nodejs.org/en/. If you run the downloaded ... Now use the version you need, nvm use 10.15.3...
Read more >
Visual Studio 2019 version 16.11 Release Notes
Get the latest features, bug fixes, and support for Visual Studio 2019 v16.11. Download today.
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