-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update: warn when used with not supported Node versions #4502
Conversation
**Summary** Fixes #4501, refs #4490, refs #4284. Yarn now warns when it detects it is running in a Node version that is not fully supported and warns the user about this. This is different than the hard Node 4+ check in the entry file since in that case, Yarn wuoldn't run at all due to syntax incompatibilities. This warning is to signal that users may encounter unexpected errors but are allowed to use Yarn if they wish. It also adds a new flag to suppress this warning: `--no-node-version-check`. **Test plan** Since we cannot add unsupported Node versions to our CI and spoof the Node version internally, this has to be tested manually, which I did.
This change will increase the build size from 9.7 MB to 9.71 MB, an increase of 10.74 KB (0%)
|
You can mock the node version if you really want to. |
@SimenB yes but that requires us to run Yarn from inside the same process that mocks the version which is not easy or may not be possible with the CLI entry point. |
@@ -98,6 +100,7 @@ export function main({ | |||
'prepend the node executable dir to the PATH in scripts', | |||
boolify, | |||
); | |||
commander.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version'); |
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.
That's a long command name :D
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.
--no-node-version-check-or-else-youll-be-fired
Trying to understand why was node 7 dropped from support? Cannot find the reason in the documents linked here. |
@mkj28 I think I dropped it unintentionally since it is not listed anywhere and it is not LTS. We do not test anything with Node 7 so we do not commit to supporting it. This doesn't mean it is going to break. |
**Summary** Fixes yarnpkg#4501, refs yarnpkg#4490, refs yarnpkg#4284. Yarn now warns when it detects it is running in a Node version that is not fully supported and warns the user about this. This is different than the hard Node 4+ check in the entry file since in that case, Yarn wouldn't run at all due to syntax incompatibilities. This warning is to signal that users may encounter unexpected errors but are allowed to use Yarn if they wish. It also adds a new flag to suppress this warning: `--no-node-version-check`. **Test plan** Since we cannot add unsupported Node versions to our CI and spoof the Node version internally, this has to be tested manually, which I did.
Summary
Fixes #4501, refs #4490, refs #4284. Yarn now warns when it
detects it is running in a Node version that is not fully
supported and warns the user about this. This is different than
the hard Node 4+ check in the entry file since in that case,
Yarn wouldn't run at all due to syntax incompatibilities. This
warning is to signal that users may encounter unexpected errors
but are allowed to use Yarn if they wish. It also adds a new
flag to suppress this warning:
--no-node-version-check
.Test plan
Since we cannot add unsupported Node versions to our CI and
spoof the Node version internally, this has to be tested
manually, which I did.