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

Allow using external Node when running tasks / plugins #4432

Closed
bahmutov opened this issue Jun 11, 2019 · 3 comments · Fixed by #4436
Closed

Allow using external Node when running tasks / plugins #4432

bahmutov opened this issue Jun 11, 2019 · 3 comments · Fixed by #4436
Assignees
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature

Comments

@bahmutov
Copy link
Contributor

Proposal

Currently, the plugins file is executed using the Node.js version included with Cypress Test Runner (like 8.2.1), which is often not the version needed to run the application. The most common problem is the inability to load native extensions when requiring NPM modules from the plugins file. The installed app for example uses Node 10 to compile extensions, while Cypress tries to load them using Node 8

So instead of using built-in Node version in packages/server/lib/plugins/index.coffee

pluginsProcess = cp.fork(path.join(__dirname, "child", "index.js"),
   ["--file", config.pluginsFile], { stdio: "inherit" })

we could find external Node and launch it as a child process

reported issues

@bahmutov bahmutov self-assigned this Jun 11, 2019
@bahmutov bahmutov added pkg/server This is due to an issue in the packages/server directory stage: proposal 💡 No work has been done of this issue labels Jun 11, 2019
@bahmutov
Copy link
Contributor Author

Finding Node

Project https://github.com/typicode/husky uses to find https://github.com/sindresorhus/run-node

I think it would be nice to configure what Node to use from cypress.json, something like

{
  "node": "built-in"
}

to use Node that comes with the Test Runner. To use specific version of Node (think NVM managing multiple versions)

{
  "node": "10.2.1"
}

or specify minimum version

{
  "node": "12"
}

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: proposal 💡 No work has been done of this issue labels Jun 11, 2019
@jennifer-shehane jennifer-shehane added the type: enhancement Requested enhancement of existing feature label Jun 12, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Jun 12, 2019
@flotwig flotwig self-assigned this Jul 12, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: work in progress labels Jul 15, 2019
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs review The PR code is done & tested, needs review labels Jul 26, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels Sep 24, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Oct 1, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 1, 2019

The code for this is done in cypress-io/cypress#4436, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 23, 2019

Released in 3.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants