Enforce minimum Node version in CLI #454
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Have you read the section in CONTRIBUTING.md about pull requests?
Yes
Summarize your changes:
If Electron Packager's CLI is run with an old version of Node, it will give a SyntaxError which is not intuitive to people what that means. This change (based on a suggestion by @MarshallOfSound in #445 (comment)) gets rid of the SyntaxError, but tells the user exactly why the CLI will not run, before exiting with a non-zero status code. (Example output below.)
Are your changes appropriately documented?
Yes (prior to this PR existing):
engines
section ofpackage.json
Do your changes have sufficient test coverage?
No, but it's dependent on Node version, so I felt it wasn't worth doing extra work just to get code coverage for this feature. I tested manually with these instructions on Linux:
nodeenv -n 0.12.15 --prebuilt /tmp/n012
source /tmp/n012/bin/activate
cd /path/to/electron-packager && ./cli.js
Expected output:
Does the testsuite pass successfully on your local machine?
Yes