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.

Hard coded Node.js version

See original GitHub issue

The config in action.yml overrides any previously set node version (e.g. via actions/setup-node): https://github.com/cypress-io/github-action/blob/ffbc3616ae4754115d05d414810ff4a8e48fc6de/action.yml#L87

This causes failures if the project requires a more recent version, or it depends on a recent version of @cypress/react >= v5.7.0

Ideally the action should use any version of node already available, or have a configuration switch to explicitly set the desired version (similar to actions/setup-node).

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
h2oearthcommented, Jun 2, 2022

This issue is still present in Cypress 10:-(. I use Node 14.x, but some how cypress was falling back to Node 12.x

4reactions
rbaylisscommented, Jan 25, 2022

I can second this issue. It seems to be happening because of this commit, combined with the fact that this action uses the Cypress node API rather than executing it as a CLI command.

Not sure exactly how to fix this, but a temporary workaround seems to be adding a command-prefix, which triggers invoking the tests with the CLI. Eg:

- name: Cypress Tests
  uses: cypress-io/github-action@v2
  with:
    record: true
    command-prefix: "--"

This is a backdoor that ends up running a cypress command like:

npx -- cypress run ...

Not sure what the side effects of this are (we’re still testing it now), but I can confirm that when run this way, it invokes with the system node version rather than the action’s node version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node js - Why does my hard coded api request to third party ...
I have a route using node js, in which i make an api request to a third party. Ive been testing in in...
Read more >
How to install different versions of node.js at the same time in ...
How to install different versions of node. js at the same time in your system. 81 views 1 month ago. Hardcoded. Hardcoded. 173...
Read more >
Nodejs hardcoded dependency vs dependency injection
There are several ways to declare dependencies for modules or components in Nodejs, each of which has its own advantages and disadvantages.
Read more >
Node v4.0.0 (Current)
Node.js v4.0.0 contains V8 v4.5, the same version of V8 shipping with the Chrome web browser today. This brings with it many bonuses...
Read more >
Node.js Coding Standards and Best Practices [Developer Guide]
For example, a severe scenario might be when an installed package is 5 patch commits behind (e.g. local version is 1.3.1 and repository...
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