Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding Node version with cypress.config.ts has no effect #29539

Open
krista-prokop opened this issue May 20, 2024 · 7 comments
Open

Overriding Node version with cypress.config.ts has no effect #29539

krista-prokop opened this issue May 20, 2024 · 7 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@krista-prokop
Copy link

Current behavior

I couldn't find documentation on how to use the node version configs, so I'm wondering if I'm missing some other element or if this is a defect. The node version & path in config have no effect:

// neither of these, alone or combined, has any effect
export default defineConfig({
	resolvedNodeVersion: '20.9.0',  
	resolvedNodePath: NODE_DIR,
}

My test output still references version 18:

┌────────────────────────────────────────────────────────────────────────────────────────────
  │ Cypress:        13.9.0                                                                         │
  │ Browser:        Electron 118 (headless)                                                        │
  │ Node Version:   v18.20.2 (C:\Program Files\nodejs\node.exe)                                    │
  │ Specs:          7 found (...)                                                     │
  │ Searched:       cypress/test/e2e/**/*.cy.***js,jsx,ts,tsx***                                       │
  └────────────────────────────────────────────────────────────────────────────────────────────

Thanks!

Desired behavior

use specified node version instead of the bundled version

Test code to reproduce

export default defineConfig({
	resolvedNodeVersion: '20.9.0',  
	resolvedNodePath: NODE_DIR,
}

Cypress Version

13.9.0

Node version

20.9.0

Operating System

Windows

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

We removed the nodeVersion config in v13: https://docs.cypress.io/guides/references/changelog#13-0-0

@krista-prokop
Copy link
Author

@jennifer-shehane I did see that but assumed nodeVersion was different from the configs I'm using - resolvedNodeVersion and resolvedNodePath. Are you saying those 2 configs are deprecated too? I saw them still being referenced in the repo :/

Can you share the correct way to specify a node path/version, if I'm not using the correct configs?

@jennifer-shehane
Copy link
Member

What are you trying to accomplish exactly?

@MikeMcC399
Copy link
Contributor

@krista-prokop

You need to install the version of Node.js that you want to use. Since you are on Windows you may consider installing and using a Node.js manager, such as nvm-windows https://github.com/coreybutler/nvm-windows/releases/tag/1.1.11, which allows you to switch between Node.js versions.

@MikeMcC399
Copy link
Contributor

You can get support from the Cypress technical community on Discord

Discord chat (click on button)

@krista-prokop
Copy link
Author

What I was hoping to do was use the node executable that is bundled with my application repo (legacy architecture/paradigms) rather than the node version installed on my ci runners.

@MikeMcC399
Copy link
Contributor

@krista-prokop

What CI system are you using? GitHub Actions or something else?

This is more of a "how-to" question which typically gets discussed in Discord, but we can continue here for your next steps.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants