cypress icon indicating copy to clipboard operation
cypress copied to clipboard

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

Open krista-prokop opened this issue 1 year ago • 7 comments

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

krista-prokop avatar May 20 '24 19:05 krista-prokop

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

jennifer-shehane avatar May 20 '24 19:05 jennifer-shehane

@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?

krista-prokop avatar May 20 '24 20:05 krista-prokop

What are you trying to accomplish exactly?

jennifer-shehane avatar May 21 '24 02:05 jennifer-shehane

@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 avatar May 21 '24 11:05 MikeMcC399

You can get support from the Cypress technical community on Discord

Discord chat (click on button)

MikeMcC399 avatar May 21 '24 11:05 MikeMcC399

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.

krista-prokop avatar May 21 '24 12:05 krista-prokop

@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.

MikeMcC399 avatar May 21 '24 12:05 MikeMcC399

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot avatar Nov 18 '24 02:11 cypress-app-bot

This issue has been closed due to inactivity.

cypress-app-bot avatar Dec 02 '24 02:12 cypress-app-bot