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

Node.js version check in yarn.js should be done earlier #1898

Closed
Daniel15 opened this issue Nov 16, 2016 · 1 comment
Closed

Node.js version check in yarn.js should be done earlier #1898

Daniel15 opened this issue Nov 16, 2016 · 1 comment
Labels

Comments

@Daniel15
Copy link
Member

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
bin/yarn.js is supposed to throw an error like "Node version x.xx is not supported, please use Node.js 4.0 or higher" when using an old Node.js version. However, when Node.js 0.10 it doesn't even reach that point, since it hits a syntax error beforehand:

yarn/lib-legacy/constants.js:7
const path = require('path');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)

What is the expected behavior?
I think we need to move the version check to the very top of yarn.js before any of our require statements are executed, so that it can exit as soon as possible when an outdated/legacy Node.js version is used.

@Daniel15 Daniel15 changed the title Node.js version check should be done earlier Node.js version check in yarn.js should be done earlier Nov 16, 2016
@hpurmann
Copy link
Contributor

hpurmann commented Nov 16, 2016

That sounds like a good first issue for me 😀 #1901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants