-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Raise an error when the version of node is older than package.json's engines.node #1922
Conversation
It's nigh-on impossible to test this other than manually. Here's the result of my manual test:
|
Two possible improvements:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nicer to print the error message without the stacktrace, but I'm not sure how to do that without adding console-specific code, which feels wrong in this file.
It seems like putting the check in the importer is the right place to have it, since that's where we need to be on that version, but I guess it could move more centrally
Lack of ESM support is the symptom you ran into, but I think there's a good chance of us using some other language feature or standard library that's only in our supported versions. I'd advocate for putting it here https://github.com/cucumber/cucumber-js/blob/main/src/cli/run.ts which is the entry point for the CLI, and where you could just do console.error
and then process.exit(1)
because as you've noted the stack trace isn't useful in this scenario.
...and look up the right version from the package.json?
Nice to have, but not essential IMO. I think it would be sufficient to add a section to the CONTRIBUTING.md
on how to manage dropping an EOL'd Node version - up to you though!
OK this is good enough now IMO. Please check and merge! |
Description
Adds a warning if the
process.version
is too old for Cucumber to work.Motivation & context
Fixes #1890 - we had a user who was running an older node version and got confused.
Type of change
Checklist: