npm run Cypress using a different Node version from the one bundled in root folder package.json #24433
DmitriiKrupinECM
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Given: Cypress was installed normally by default in the project root folder, thus it uses the package.json file and its dependencies.
However, the root project is an Angular part of the project that uses a pretty outdated version of Node JS (10.xx).
There is also a react subfolder that has its separate package.json with a newer version.
Actual: after updating to Cypress 10.xx, the npm run/open commands won't properly work for Cypress anymore when it tries to run it from the root project folder (and use Node v10).
This is especially tricky when running on an agent in the CI pipeline (locally I can at least use nvm to specifically select the local version before running) it tries to use the bundled Node 10 and fails.
Expected: is there a way to overrride the "dependencies -> node" value in the root folder package.json file when running Cypress with npm?
Or I would need to move Cypress to a separate folder and create separate dependencies for it?
Any thoughts on how to move on with this WITHOUT updating the project node version (as it may screw up the Angular part of the app) are welcome.
Beta Was this translation helpful? Give feedback.
All reactions