question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need to handle Node <4 users better (show better error message, possibly lock down version)

See original GitHub issue

The version of ESLint you are using.

3.x

The problem you want to solve.

Provide better error messages when users running an unsupported Node engine version are using ESLint.

Your take on the correct solution to problem.

Two basic options:

  1. Detect Node engine version and throw an exception for unsupported versions (using package.json to avoid hardcoding, and ideally using a pre-existing package)
  2. Attempt to catch certain exceptions (anything indicating an ES6 syntax error basically) in bin/eslint.js and display a nicer message to the user

Not sure which is the better option (or if there is a superior third option). Let’s discuss!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
albertocommented, Jul 8, 2016

I’m not sure we should do anything here. It’s clearly documented in the migration guide and npm already shows a warning.

1reaction
mysticateacommented, Jul 21, 2016

@epoberezkin I think that linting is not required in all node versions in CI, so you can consider a use of if-node-version-like tool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

15 Common Error Codes in Node.js and How to Fix Them
Therefore, we've compiled this list of 15 common Node.js errors along with one or more strategies to follow to fix each one.
Read more >
[BUG] npm ci can't resolve dependencies without --force, or ...
A package-lock.json file that works/was created in an older version of 8.x does not work when using a newer version of 8.x. Any...
Read more >
Is there any way to fix package-lock.json lockfileVersion so ...
json was generated for lockfileVersion@2. I'll try to do my best with it! Is there any way to specify to newer versions of...
Read more >
Error Codes | Yarn - Package Manager
A list of Yarn's error codes with detailed explanations.
Read more >
Top 10 Most Common Node.js Developer Mistakes - Toptal
Mistake #2: Invoking a Callback More Than Once. JavaScript has relied on callbacks since forever. In web browsers, events are handled by passing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found